@@ -55,14 +55,14 @@ func TestPostgreSQLParameters(t *testing.T) {
55
55
assert .DeepEqual (t , parameters .Mandatory .AsMap (), map [string ]string {
56
56
"archive_mode" : "on" ,
57
57
"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" ,
66
66
}, "" ),
67
67
"restore_command" : "/bin/true" ,
68
68
"track_commit_timestamp" : "true" ,
0 commit comments