mirror of
https://github.com/postgres/postgres.git
synced 2025-12-12 02:37:31 +03:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user