Re: Test to dump and restore objects left behind by regression
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Michael Paquier <michael@paquier.xyz>,
Daniel Gustafsson <daniel@yesql.se>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Eisentraut <peter@eisentraut.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-03-19T11:43:12Z
Lists: pgsql-hackers
Attachments
- 0002-Do-not-dump-statistics-in-the-file-dumped-f-20250319.patch (text/x-patch) patch 0002
- 0001-Test-pg_dump-restore-of-regression-objects-20250319.patch (text/x-patch) patch 0001
On Thu, Mar 13, 2025 at 6:10 PM Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote: > > > > I think the fix is to explicitly pass --lc-monetary to the old cluster > > and the restored cluster. 003 patch in the attached patch set does > > that. Please check if it fixes the issue for you. > > > > Additionally we should check that it gets copied to the new cluster as > > well. But I haven't figured out how to get those settings yet. This > > treatment is similar to how --lc-collate and --lc-ctype are treated. I > > am wondering whether we should explicitly pass --lc-messages, > > --lc-time and --lc-numeric as well. > > > > 2d819a08a1cbc11364e36f816b02e33e8dcc030b introduced buildin locale > > provider and added overrides to LC_COLLATE and LC_TYPE. But it did not > > override other LC_, which I think it should have. In pure upgrade > > test, the upgraded node inherits the locale settings of the original > > cluster, so this wasn't apparent. But with pg_dump testing, the > > original and restored databases are independent. Hence I think we have > > to override all LC_* settings by explicitly mentioning --lc-* options > > to initdb. Please let me know what you think about this? > > Investigated this further. The problem is that the pg_regress run creates regression database with specific properties but the restored database does not have those properties. That led me to a better solution. Additionally it's local to the new test. Use --create when dumping and restoring the regression database. This way the database properties or "configuration variable settings (as pg_dump documentation calls them) are copied to the restored database as well. Those properties include LC_MONETARY. Additionally now the test covers --create option as well. PFA patches. -- Best Wishes, Ashutosh Bapat
Commits
-
Hide expensive pg_upgrade test behind PG_TEST_EXTRA
- d185161e4739 18.0 landed
- 37fc1803cc12 19 (unreleased) landed
-
Set log_statement=none in t/002_pg_upgrade.pl
- 64fba9c61787 18.0 landed
-
002_pg_upgrade.pl: Move pg_dump test code for better stability
- 8806e4e8deb1 18.0 landed
-
002_pg_upgrade.pl: rename some variables for clarity
- abe56227b2e2 18.0 landed
-
Verify roundtrip dump/restore of regression database
- 172259afb563 18.0 landed
-
Refactor TAP test code for file comparisons into new routine in Utils.pm
- 169208092f5c 18.0 landed
-
Virtual generated columns
- 83ea6c54025b 18.0 cited
-
Put generated_stored test objects in a schema
- 894be11adfa6 18.0 cited
-
Introduce "builtin" collation provider.
- 2d819a08a1cb 17.0 cited
-
Revert "Improve compression and storage support with inheritance"
- 74563f6b9021 17.0 cited