mirror of
https://github.com/postgres/postgres.git
synced 2025-12-15 02:22:24 +03:00
Code for WITHOUT OIDS.
On Wed, 2003-01-08 at 21:59, Christopher Kings-Lynne wrote: > I agree. I want to remove OIDs from heaps of our tables when we go to 7.3. > I'd rather not have to do it in the dump due to down time. Rod Taylor <rbt@rbt.ca>
This commit is contained in:
@@ -1179,6 +1179,62 @@ order by relname, attnum;
|
||||
drop table p1, p2 cascade;
|
||||
NOTICE: Drop cascades to table c1
|
||||
NOTICE: Drop cascades to table gc1
|
||||
--
|
||||
-- Test the ALTER TABLE WITHOUT OIDS command
|
||||
--
|
||||
create table altstartwith (col integer) with oids;
|
||||
insert into altstartwith values (1);
|
||||
select oid > 0, * from altstartwith;
|
||||
?column? | col
|
||||
----------+-----
|
||||
t | 1
|
||||
(1 row)
|
||||
|
||||
alter table altstartwith set without oids;
|
||||
select oid > 0, * from altstartwith; -- fails
|
||||
ERROR: Attribute "oid" not found
|
||||
select * from altstartwith;
|
||||
col
|
||||
-----
|
||||
1
|
||||
(1 row)
|
||||
|
||||
-- Run inheritance tests
|
||||
create table altwithoid (col integer) with oids;
|
||||
-- Inherits parents oid column
|
||||
create table altinhoid () inherits (altwithoid) without oids;
|
||||
insert into altinhoid values (1);
|
||||
select oid > 0, * from altwithoid;
|
||||
?column? | col
|
||||
----------+-----
|
||||
t | 1
|
||||
(1 row)
|
||||
|
||||
select oid > 0, * from altinhoid;
|
||||
?column? | col
|
||||
----------+-----
|
||||
t | 1
|
||||
(1 row)
|
||||
|
||||
alter table altwithoid set without oids;
|
||||
alter table altinhoid set without oids; -- fails
|
||||
ERROR: ALTER TABLE: Table is already WITHOUT OIDS
|
||||
select oid > 0, * from altwithoid; -- fails
|
||||
ERROR: Attribute "oid" not found
|
||||
select oid > 0, * from altinhoid; -- fails
|
||||
ERROR: Attribute "oid" not found
|
||||
select * from altwithoid;
|
||||
col
|
||||
-----
|
||||
1
|
||||
(1 row)
|
||||
|
||||
select * from altinhoid;
|
||||
col
|
||||
-----
|
||||
1
|
||||
(1 row)
|
||||
|
||||
-- test renumbering of child-table columns in inherited operations
|
||||
create table p1 (f1 int);
|
||||
create table c1 (f2 text, f3 int) inherits (p1);
|
||||
|
||||
@@ -850,6 +850,39 @@ order by relname, attnum;
|
||||
|
||||
drop table p1, p2 cascade;
|
||||
|
||||
--
|
||||
-- Test the ALTER TABLE WITHOUT OIDS command
|
||||
--
|
||||
create table altstartwith (col integer) with oids;
|
||||
|
||||
insert into altstartwith values (1);
|
||||
|
||||
select oid > 0, * from altstartwith;
|
||||
|
||||
alter table altstartwith set without oids;
|
||||
|
||||
select oid > 0, * from altstartwith; -- fails
|
||||
select * from altstartwith;
|
||||
|
||||
-- Run inheritance tests
|
||||
create table altwithoid (col integer) with oids;
|
||||
|
||||
-- Inherits parents oid column
|
||||
create table altinhoid () inherits (altwithoid) without oids;
|
||||
|
||||
insert into altinhoid values (1);
|
||||
|
||||
select oid > 0, * from altwithoid;
|
||||
select oid > 0, * from altinhoid;
|
||||
|
||||
alter table altwithoid set without oids;
|
||||
alter table altinhoid set without oids; -- fails
|
||||
|
||||
select oid > 0, * from altwithoid; -- fails
|
||||
select oid > 0, * from altinhoid; -- fails
|
||||
select * from altwithoid;
|
||||
select * from altinhoid;
|
||||
|
||||
-- test renumbering of child-table columns in inherited operations
|
||||
|
||||
create table p1 (f1 int);
|
||||
|
||||
Reference in New Issue
Block a user