feat: support PostgreSQL 19 beta 2 - #97
Conversation
Add the exact beta image to the compatibility matrix and make report failures observable in CI. Exercise both display modes, preload pg_stat_statements, and test interactive role reports.\n\nRelates to #96
| output=$(PGOPTIONS='-c postgres_dba.wide=off' PAGER='cat' psql \ | ||
| --no-psqlrc \ | ||
| --set=ON_ERROR_STOP=1 \ | ||
| --set=postgres_dba_interactive_mode=false \ | ||
| --host=localhost \ | ||
| --username=dba_user \ | ||
| --dbname=test \ | ||
| --file=warmup.psql \ | ||
| --file=sql/0_node.sql) | ||
| if [[ "${output}" != *Primary* ]]; then | ||
| echo "Role test failed: ${output}" >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
The wide and normal mode tests above use if ! output=$(... 2>&1) to check the psql exit code and capture stderr. The four regression tests below don't follow the same pattern — they only check the output content and ignore the exit code. For three of the four tests, stderr isn't captured either, so any psql error message won't appear in the failure output, making CI failures harder to debug.
Consider wrapping these in the same if ! pattern so SQL errors (caught by ON_ERROR_STOP) surface explicitly. Same applies to the x1_alignment_padding, a1_activity, and i3_non_indexed_fks tests below.
| output=$(PGOPTIONS='-c postgres_dba.wide=off' PAGER='cat' psql \ | |
| --no-psqlrc \ | |
| --set=ON_ERROR_STOP=1 \ | |
| --set=postgres_dba_interactive_mode=false \ | |
| --host=localhost \ | |
| --username=dba_user \ | |
| --dbname=test \ | |
| --file=warmup.psql \ | |
| --file=sql/0_node.sql) | |
| if [[ "${output}" != *Primary* ]]; then | |
| echo "Role test failed: ${output}" >&2 | |
| exit 1 | |
| fi | |
| if ! output=$(PGOPTIONS='-c postgres_dba.wide=off' PAGER='cat' psql \ | |
| --no-psqlrc \ | |
| --set=ON_ERROR_STOP=1 \ | |
| --set=postgres_dba_interactive_mode=false \ | |
| --host=localhost \ | |
| --username=dba_user \ | |
| --dbname=test \ | |
| --file=warmup.psql \ | |
| --file=sql/0_node.sql 2>&1); then | |
| echo "Role test failed: ${output}" >&2 | |
| exit 1 | |
| fi | |
| if [[ "${output}" != *Primary* ]]; then | |
| echo "Role test failed: ${output}" >&2 | |
| exit 1 | |
| fi |
samorev Code Review Report
BLOCKING ISSUES (11)CRITICAL
HIGH [bugs] Wide mode is almost certainly not enabled — the psql variable
MEDIUM [bugs] In the i3 regression test, psql's stderr is captured into
MEDIUM [security] The failure-path redaction for the role reports is a guessed regex.
MEDIUM [docs] RELEASE_NOTES.md is rewritten in place rather than prepended to — the entire 7.0 section (~70 lines) is deleted. That erases the only record of the c1–c4 corruption checks, m1/s3/t2, the b6→m1 / c1→p1 / p1→x1 renames, and the s1/s2/i3/m1/i2 bug fixes. The rename table in particular is migration-critical for existing users, and this PR (a PG19 compatibility + CI change) has no reason to remove it.
LOW [docs] The version scheme silently changes from semver (
LOW [tests] The server-version assertion is asymmetric — it only fires for
LOW [tests] The regression assertions were weakened when
LOW [tests] The new r1 test asserts only that
LOW [bugs] The hand-rolled container has a fixed name and no teardown. Nothing stops or removes
LOW [security] The container publishes a trust-authenticated superuser Postgres on all interfaces of the runner (
Summary
Note:
Review metadatasamorev-assisted review (AI analysis by Tanya301/samorev) |
Address actionable samorev findings: preserve release history, remove duplicate mode coverage, restrict and clean up the test database, validate every matrix version, avoid password material in logs, and improve regression diagnostics.\n\nRelates to #96
| echo "Error output:" | ||
| PAGER=cat psql -h localhost -U dba_user -d test --no-psqlrc -f warmup.psql -f "$f" | ||
| exit 1 | ||
| echo "Testing all non-interactive reports with minimal privileges..." |
There was a problem hiding this comment.
This step only exercises normal mode. warmup.psql reads postgres_dba.wide as a server-side GUC (current_setting('postgres_dba.wide', true)), not a psql variable, so --set won't enable wide mode. Consider wrapping this loop in an outer for mode in normal wide iteration and setting PGOPTIONS='-c postgres_dba.wide=on' for the wide pass to catch wide-mode regressions in CI.
Require SCRAM authentication for the generated test role, verify both created and rotated passwords, and reject the previous password after rotation. Keep password-bearing report output out of CI logs.\n\nRelates to #96
Use the version-compatible md5 HBA method. PostgreSQL 13 authenticates its MD5 verifier, while newer releases negotiate SCRAM when the stored verifier is SCRAM. Relates to #96
samorev Code Review Report
CI: Prior review reconciliationVerified as genuinely fixed: loopback-only publish, Two prior findings were wrong and are withdrawn:
BLOCKING ISSUES (1)MEDIUM
NON-BLOCKING (4)LOW
LOW
LOW
INFO
POTENTIAL ISSUES (8)Moderate confidence (4-7/10) — review manually, some may be acceptable trade-offs. MEDIUM
MEDIUM
MEDIUM
MEDIUM
LOW
LOW
MEDIUM
INFO
Summary
Findings = 5 → 1 blocking + 4 non-blocking, matching the section headers above. Filtered (checked and ruled out, not reported as issues):
Also verified clean and deliberately not flagged: mask ordering on every path; no pg_stat_statements Result: FAILED — 1 blocking issue. samorev-assisted review (AI analysis by postgres-ai/rev) |
Guard the remaining grep assertion, require the expected authentication failure, retain server logs on failed jobs, and harden the version, pg_stat_statements, HBA, and role-state checks. Relates to #96
samorev Code Review Report
CI: Prior review reconciliationEvery finding from the previous pass is fixed in
Also independently re-verified: NON-BLOCKING (2)LOW
INFO PR description — still carries the "
POTENTIAL ISSUES (2)Moderate confidence (4-7/10) — review manually, may be acceptable trade-offs. LOW
LOW
Summary
Filtered (checked, disproven — recorded so they are not re-raised):
No blocking issues. Test-quality gaps only; the change is sound, and the PostgreSQL 19 beta 2 coverage it Result: PASSED samorev-assisted review (AI analysis by postgres-ai/rev) |
Print the last psql result when the password-authentication rule does not become active. Relates to #96
| pgss_rows=$(PAGER='cat' psql \ | ||
| --no-psqlrc \ | ||
| --set=ON_ERROR_STOP=1 \ | ||
| --host=localhost \ | ||
| --username=dba_user \ | ||
| --dbname=test \ | ||
| --tuples-only \ | ||
| --no-align \ | ||
| --command='select count(*) from pg_stat_statements;') | ||
| if (( pgss_rows == 0 )); then | ||
| echo 'pg_stat_statements did not capture any statements' >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
If the psql query fails (e.g., pg_stat_statements view inaccessible), pgss_rows will contain the error message text instead of a number. Bash then evaluates (( pgss_rows == 0 )) as a syntax error (exit code 1 = false), so the if block is skipped entirely — the health check is silently bypassed and the test continues without verifying pg_stat_statements is working.
Wrapping the command substitution in an if ! guard catches the psql failure explicitly:
| pgss_rows=$(PAGER='cat' psql \ | |
| --no-psqlrc \ | |
| --set=ON_ERROR_STOP=1 \ | |
| --host=localhost \ | |
| --username=dba_user \ | |
| --dbname=test \ | |
| --tuples-only \ | |
| --no-align \ | |
| --command='select count(*) from pg_stat_statements;') | |
| if (( pgss_rows == 0 )); then | |
| echo 'pg_stat_statements did not capture any statements' >&2 | |
| exit 1 | |
| fi | |
| if ! pgss_rows=$(PAGER='cat' psql \ | |
| --no-psqlrc \ | |
| --set=ON_ERROR_STOP=1 \ | |
| --host=localhost \ | |
| --username=dba_user \ | |
| --dbname=test \ | |
| --tuples-only \ | |
| --no-align \ | |
| --command='select count(*) from pg_stat_statements;'); then | |
| echo 'pg_stat_statements query failed' >&2 | |
| exit 1 | |
| fi | |
| if (( pgss_rows == 0 )); then | |
| echo 'pg_stat_statements did not capture any statements' >&2 | |
| exit 1 | |
| fi |
Summary
ON_ERROR_STOPas a non-superuserpg_monitormember with the required object grantspg_stat_statementsand functionally test both interactive role reportsVerification
actionlint1.7.7, YAML parser, andgit diff --checkRelates to #96