diff options
author | Robert Haas <rhaas@postgresql.org> | 2012-01-26 12:44:30 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2012-01-26 12:44:30 -0500 |
commit | 2d1371d3ee5cf7e96d16fb503c27e060df9497f7 (patch) | |
tree | 81a6bd30cbd11690af639908e36ce4b4b34107b5 /src/test | |
parent | d4bad4e1e1c7269b906f3b005fc322537630efcf (diff) |
Be more clear when a new column name collides with a system column name.
We now use the same error message for ALTER TABLE .. ADD COLUMN or
ALTER TABLE .. RENAME COLUMN that we do for CREATE TABLE. The old
message was accurate, but might be confusing to users not aware of our
system columns.
Vik Reykja, with some changes by me, and further proofreading by Tom Lane
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/regress/expected/alter_table.out | 2 | ||||
-rw-r--r-- | src/test/regress/expected/errors.out | 2 | ||||
-rw-r--r-- | src/test/regress/sql/alter_table.sql | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out index e9925495042..4aba58c4503 100644 --- a/src/test/regress/expected/alter_table.out +++ b/src/test/regress/expected/alter_table.out @@ -7,6 +7,8 @@ COMMENT ON TABLE tmp_wrong IS 'table comment'; ERROR: relation "tmp_wrong" does not exist COMMENT ON TABLE tmp IS 'table comment'; COMMENT ON TABLE tmp IS NULL; +ALTER TABLE tmp ADD COLUMN xmin integer; -- fails +ERROR: column name "xmin" conflicts with a system column name ALTER TABLE tmp ADD COLUMN a int4 default 3; ALTER TABLE tmp ADD COLUMN b name; ALTER TABLE tmp ADD COLUMN c text; diff --git a/src/test/regress/expected/errors.out b/src/test/regress/expected/errors.out index 4a10c6ae8a0..fa0bd82819a 100644 --- a/src/test/regress/expected/errors.out +++ b/src/test/regress/expected/errors.out @@ -109,7 +109,7 @@ alter table emp rename column salary to manager; ERROR: column "manager" of relation "stud_emp" already exists -- conflict alter table emp rename column salary to oid; -ERROR: column "oid" of relation "stud_emp" already exists +ERROR: column name "oid" conflicts with a system column name -- -- TRANSACTION STUFF -- not in a xact diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql index d9bf08d6d50..d4e4c4958d1 100644 --- a/src/test/regress/sql/alter_table.sql +++ b/src/test/regress/sql/alter_table.sql @@ -9,6 +9,8 @@ COMMENT ON TABLE tmp_wrong IS 'table comment'; COMMENT ON TABLE tmp IS 'table comment'; COMMENT ON TABLE tmp IS NULL; +ALTER TABLE tmp ADD COLUMN xmin integer; -- fails + ALTER TABLE tmp ADD COLUMN a int4 default 3; ALTER TABLE tmp ADD COLUMN b name; |