From 24614a988005a0811198458fc934b87375582168 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 23 Mar 2004 19:35:17 +0000 Subject: Upgrade ALTER TABLE DROP COLUMN so that it can drop an OID column, and remove separate implementation of ALTER TABLE SET WITHOUT OIDS in favor of doing a regular DROP. Also, cause CREATE TABLE to account completely correctly for the inheritance status of the OID column. This fixes problems with dropping OID columns that have dependencies, as noted by Christopher Kings-Lynne, as well as making sure that you can't drop an OID column that was inherited from a parent. --- src/test/regress/expected/alter_table.out | 6 ++++-- src/test/regress/sql/alter_table.sql | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out index 0396351f1ff..089651c7278 100644 --- a/src/test/regress/expected/alter_table.out +++ b/src/test/regress/expected/alter_table.out @@ -688,9 +688,11 @@ delete from atacc1; -- try dropping a non-existent column, should fail alter table atacc1 drop bar; ERROR: column "bar" of relation "atacc1" does not exist --- try dropping the oid column, should fail +-- try dropping the oid column, should succeed alter table atacc1 drop oid; -ERROR: cannot drop system column "oid" +-- try dropping the xmin column, should fail +alter table atacc1 drop xmin; +ERROR: cannot drop system column "xmin" -- try creating a view and altering that, should fail create view myview as select * from atacc1; select * from myview; diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql index 749af267107..dcd968a0b65 100644 --- a/src/test/regress/sql/alter_table.sql +++ b/src/test/regress/sql/alter_table.sql @@ -632,9 +632,12 @@ delete from atacc1; -- try dropping a non-existent column, should fail alter table atacc1 drop bar; --- try dropping the oid column, should fail +-- try dropping the oid column, should succeed alter table atacc1 drop oid; +-- try dropping the xmin column, should fail +alter table atacc1 drop xmin; + -- try creating a view and altering that, should fail create view myview as select * from atacc1; select * from myview; -- cgit v1.2.3