git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: eba331a) | patch
Fix two issues with HEADER MATCH in COPY
2022年6月23日 01:49:20 +0000 (10:49 +0900)
2022年6月23日 01:49:20 +0000 (10:49 +0900)
commit ca7a0d1d368216e89359c63531a4df0b99a437e4
Fix two issues with HEADER MATCH in COPY

072132f0 used the attnum offset to access the raw_fields array when
checking that the attribute names of the header and of the relation
match, leading to incorrect results or even crashes if the attribute
numbers of a relation are changed, like on a dropped attribute. This
fixes the logic to use the correct attribute names for the header
matching requirements.

Also, this commit disallows HEADER MATCH in COPY TO as there is no
validation that can be done in this case.

The tests are expanded for HEADER MATCH with COPY FROM and dropped
columns, with cases where a relation has a dropped and re-added column,
as well as a reduced set of columns.

Author: Julien Rouhaud
Reviewed-by: Peter Eisentraut, Michael Paquier
Discussion: https://postgr.es/m/20220607154744.vvmitnqhyxrne5ms@jrouhaud
doc/src/sgml/ref/copy.sgml diff | blob | blame | history
src/backend/commands/copy.c diff | blob | blame | history
src/backend/commands/copyfromparse.c diff | blob | blame | history
src/test/regress/expected/copy.out diff | blob | blame | history
src/test/regress/sql/copy.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /