@@ -55,14 +55,14 @@ func TestPostgreSQLParameters(t *testing.T) {
5555 assert .DeepEqual (t , parameters .Mandatory .AsMap (), map [string ]string {
5656 "archive_mode" : "on" ,
5757 "archive_command" : strings .Join ([]string {
58- `pgbackrest --stanza=db archive-push "%p"` ,
59- ` && timestamp=$(pg_waldump "%p" | grep COMMIT | awk '{print $(NF ` ,
60- `-2) "T" $(NF-1) " " $(NF)}' | sed -E 's/([0-9]{4}-[0-9]{2}-[0-9] ` ,
61- `{2}T [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{6}) (UTC|[\+\ -][0-9]{2})/\` ,
62- `1\2/' | sed ' s/UTC/Z/' | tail -n 1 | grep -E '^[0-9]{4}-[0-9]{2} ` ,
63- `-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{6}(Z|[\+\-][0-9]{2})` ,
64- "$'); if [ ! -z ${timestamp} ]; then echo ${timestamp} > /pgdata/l" ,
65- "atest_commit_timestamp .txt; fi" ,
58+ `pgbackrest --stanza=db archive-push "%p" ` ,
59+ `&& timestamp=$(pg_waldump "%p" | ` ,
60+ `grep -oP "COMMIT \K[^;]+" | ` ,
61+ `sed -E "s/([0-9]{4}-[0-9]{2}- [0-9]{2}) ([0-9]{2} :[0-9]{2}:[0-9]{2}\.[0-9]{6}) (UTC|[\\+\\ -][0-9]{2})/\1T\2\3/" | ` ,
62+ `sed " s/UTC/Z/" | ` ,
63+ "tail -n 1 | " ,
64+ `grep -E "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{6}(Z|[\+\-][0-9]{2})$"); ` ,
65+ "if [ ! -z ${timestamp} ]; then echo ${timestamp} > /pgdata/latest_commit_timestamp .txt; fi" ,
6666 }, "" ),
6767 "restore_command" : "/bin/true" ,
6868 "track_commit_timestamp" : "true" ,
0 commit comments