pgsql: pg_dump: Don't emit OVERRIDING SYSTEM VALUE for dropped identity
pgsql: pg_dump: Don't emit OVERRIDING SYSTEM VALUE for dropped identity
От:
Fujii Masao <fujii@postgresql.org>
Дата:
pg_dump: Don't emit OVERRIDING SYSTEM VALUE for dropped identity columns When a table's only GENERATED ALWAYS AS IDENTITY column had been dropped, pg_dump --inserts and --column-inserts could still emit OVERRIDING SYSTEM VALUE in INSERT statements. This clause has no effect when restoring into PostgreSQL but introduces unnecessary differences between dumps of otherwise equivalent tables. ALTER TABLE ... DROP COLUMN leaves pg_attribute.attidentity unchanged. getTableAttrs() used this field to set needs_override without checking attisdropped, so a dropped identity column could trigger the clause even when no remaining column required it. Ignore dropped columns when determining whether to emit the clause, so that the output reflects only the table's remaining columns. Apply to master only, since the unnecessary clause does not affect restoration into PostgreSQL and does not warrant backpatching. Author: William Bernbaum Reviewed-by: Andreas Karlsson Reviewed-by: solai v Reviewed-by: shihao zhong Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/PH0PR18MB44430C10F7431F8D163CDAFFA6202@PH0PR18MB4443.namprd18.prod.outlook.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/cde33148c9d8cc432296992eaa5c2f58a126712d Modified Files -------------- src/bin/pg_dump/pg_dump.c | 11 ++++++- src/bin/pg_dump/t/002_pg_dump.pl | 67 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-)