1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Change the interpretation of the primary_key_attnums parameter of

dblink_build_sql_insert() and related functions.  Now the column numbers
are treated as logical not physical column numbers.  This will provide saner
behavior in the presence of dropped columns; furthermore, if we ever get
around to allowing rearrangement of logical column ordering, the original
definition would become nearly untenable from a usability standpoint.
Per recent discussion of dblink's handling of dropped columns.
Not back-patched for fear of breaking existing applications.
This commit is contained in:
Tom Lane
2010-06-15 20:29:01 +00:00
parent 77a4c51af8
commit c0989c67fa
4 changed files with 85 additions and 17 deletions

View File

@ -430,11 +430,11 @@ ALTER TABLE test_dropped
ADD COLUMN col3 VARCHAR(10) NOT NULL DEFAULT 'foo',
ADD COLUMN col4 INT NOT NULL DEFAULT 42;
SELECT dblink_build_sql_insert('test_dropped', '2', 1,
SELECT dblink_build_sql_insert('test_dropped', '1', 1,
ARRAY['1'::TEXT], ARRAY['2'::TEXT]);
SELECT dblink_build_sql_update('test_dropped', '2', 1,
SELECT dblink_build_sql_update('test_dropped', '1', 1,
ARRAY['1'::TEXT], ARRAY['2'::TEXT]);
SELECT dblink_build_sql_delete('test_dropped', '2', 1,
SELECT dblink_build_sql_delete('test_dropped', '1', 1,
ARRAY['2'::TEXT]);