Hi William and everyone,

I was able to reproduce the reported issue on an unpatched PostgreSQL
20devel build.

I used the following scenario:
-Created a table with a GENERATED ALWAYS AS IDENTITY column.
-Inserted a row.
-Dropped the identity column.
-Added the primary key on the remaining columns.
-Ran pg_dump --data-only --inserts.

With the unpatched build, pg_dump produced:
INSERT INTO public.demo OVERRIDING SYSTEM VALUE VALUES (1, 2);
even though the table no longer had an identity column.

I then applied the v2 patch:
v2-0001-pg_dump-Don-t-emit-OVERRIDING-SYSTEM-VALUE-for-dr.patch

The patch applied cleanly, and git diff --check reported no issues.
After rebuilding PostgreSQL, I ran the same pg_dump command again.
This time the output was:
INSERT INTO public.demo VALUES (1, 2);
The OVERRIDING SYSTEM VALUE clause was no longer emitted.
So, based on this test, the patch fixes the reported behavior.

I will also run the added regression tests in
src/bin/pg_dump/t/002_pg_dump.pl  to verify the test coverage.

Thanks for the patch and for the clear reproduction case.

Regards,
solai


Reply via email to