1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

pg_stat_statements: Fix test that assumes wal_records = rows.

It's not very robust to assume that each inserted row will produce
exactly one WAL record and that no other WAL records will be generated
in the process, because for example a particular transaction could
always be the one that has to extend clog.

Because these tests are not run by 'make installcheck' but only by
'make check', it may be that in our current testing infrastructure
this can't be hit, but it doesn't seem like a good idea to rely on
that, since unrelated changes to the regression tests or the way
write-ahead logging is done could easily cause it to start happening,
and debugging such failures is a pain.

Adjust the regression test to be less sensitive.

Anton Melnikov, reviewed by Julien Rouhaud

Discussion: http://postgr.es/m/1ccd00d9-1723-6b68-ae56-655aab00d406@inbox.ru
This commit is contained in:
Robert Haas
2022-07-06 13:05:51 -04:00
parent 7b64e4b3fa
commit 2d7ead8526
2 changed files with 5 additions and 5 deletions

View File

@ -122,7 +122,7 @@ SET pg_stat_statements.track_utility = FALSE;
SELECT query, calls, rows,
wal_bytes > 0 as wal_bytes_generated,
wal_records > 0 as wal_records_generated,
wal_records = rows as wal_records_as_rows
wal_records >= rows as wal_records_ge_rows
FROM pg_stat_statements ORDER BY query COLLATE "C";
--