aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/expected/inherit.out
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/expected/inherit.out')
-rw-r--r--src/test/regress/expected/inherit.out49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/test/regress/expected/inherit.out b/src/test/regress/expected/inherit.out
index 38ea8e86f3c..a8c8b28a75e 100644
--- a/src/test/regress/expected/inherit.out
+++ b/src/test/regress/expected/inherit.out
@@ -612,6 +612,55 @@ select * from d;
32 | one | two | three
(1 row)
+-- check that oid column is handled properly during alter table inherit
+create table oid_parent (a int) with oids;
+create table oid_child () inherits (oid_parent);
+select attinhcount, attislocal from pg_attribute
+ where attrelid = 'oid_child'::regclass and attname = 'oid';
+ attinhcount | attislocal
+-------------+------------
+ 1 | f
+(1 row)
+
+drop table oid_child;
+create table oid_child (a int) without oids;
+alter table oid_child inherit oid_parent; -- fail
+ERROR: table "oid_child" without OIDs cannot inherit from table "oid_parent" with OIDs
+alter table oid_child set with oids;
+select attinhcount, attislocal from pg_attribute
+ where attrelid = 'oid_child'::regclass and attname = 'oid';
+ attinhcount | attislocal
+-------------+------------
+ 0 | t
+(1 row)
+
+alter table oid_child inherit oid_parent;
+select attinhcount, attislocal from pg_attribute
+ where attrelid = 'oid_child'::regclass and attname = 'oid';
+ attinhcount | attislocal
+-------------+------------
+ 1 | t
+(1 row)
+
+alter table oid_child set without oids; -- fail
+ERROR: cannot drop inherited column "oid"
+alter table oid_parent set without oids;
+select attinhcount, attislocal from pg_attribute
+ where attrelid = 'oid_child'::regclass and attname = 'oid';
+ attinhcount | attislocal
+-------------+------------
+ 0 | t
+(1 row)
+
+alter table oid_child set without oids;
+select attinhcount, attislocal from pg_attribute
+ where attrelid = 'oid_child'::regclass and attname = 'oid';
+ attinhcount | attislocal
+-------------+------------
+(0 rows)
+
+drop table oid_parent cascade;
+NOTICE: drop cascades to table oid_child
-- Test non-inheritable parent constraints
create table p1(ff1 int);
alter table p1 add constraint p1chk check (ff1 > 0) no inherit;