postgresql/doc
Michael Paquier ca7a0d1d36 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
2022-06-23 10:49:20 +09:00
..
src Fix two issues with HEADER MATCH in COPY 2022-06-23 10:49:20 +09:00
KNOWN_BUGS
Makefile Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
MISSING_FEATURES
TODO Change documentation references to PG website to use https: not http: 2017-05-20 21:50:47 -04:00