Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5df3fc6

Browse files
author
Neil Conway
committed
This patch updates the regression tests to allow "make installcheck" to
pass if "default_with_oids" is set to false. I took the approach of explicitly adding WITH OIDS to the CREATE TABLEs where necessary, rather than tweaking the default_with_oids GUC var.
1 parent fa471da commit 5df3fc6

File tree

8 files changed

+14
-20
lines changed

8 files changed

+14
-20
lines changed

src/test/regress/expected/alter_table.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ drop table atacc3;
318318
drop table atacc2;
319319
drop table atacc1;
320320
-- test unique constraint adding
321-
create table atacc1 ( test int );
321+
create table atacc1 ( test int ) with oids;
322322
-- add a unique constraint
323323
alter table atacc1 add constraint atacc_test1 unique (test);
324324
NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index "atacc_test1" for table "atacc1"
@@ -378,7 +378,7 @@ insert into atacc1 (test2, test) values (2, 3);
378378
ERROR: duplicate key violates unique constraint "atacc1_test_key"
379379
drop table atacc1;
380380
-- test primary key constraint adding
381-
create table atacc1 ( test int );
381+
create table atacc1 ( test int ) with oids;
382382
-- add a primary key constraint
383383
alter table atacc1 add constraint atacc_test1 primary key (test);
384384
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "atacc_test1" for table "atacc1"
@@ -476,7 +476,7 @@ alter table non_existent alter column bar drop not null;
476476
ERROR: relation "non_existent" does not exist
477477
-- test setting columns to null and not null and vice versa
478478
-- test checking for null values and primary key
479-
create table atacc1 (test int not null);
479+
create table atacc1 (test int not null) with oids;
480480
alter table atacc1 add constraint "atacc1_pkey" primary key (test);
481481
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "atacc1_pkey" for table "atacc1"
482482
alter table atacc1 alter column test drop not null;
@@ -598,7 +598,7 @@ ERROR: permission denied: "pg_class" is a system catalog
598598
alter table nosuchtable drop column bar;
599599
ERROR: relation "nosuchtable" does not exist
600600
-- test dropping columns
601-
create table atacc1 (a int4 not null, b int4, c int4 not null, d int4);
601+
create table atacc1 (a int4 not null, b int4, c int4 not null, d int4) with oids;
602602
insert into atacc1 values (1, 2, 3, 4);
603603
alter table atacc1 drop a;
604604
alter table atacc1 drop a;

src/test/regress/expected/copy2.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CREATE TABLE x (
44
c text not null default 'stuff',
55
d text,
66
e text
7-
);
7+
) WITH OIDS;
88
NOTICE: CREATE TABLE will create implicit sequence "x_a_seq" for serial column "x.a"
99
CREATE FUNCTION fn_x_before () RETURNS TRIGGER AS '
1010
BEGIN

src/test/regress/expected/create_table.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ CREATE TABLE tenk1 (
4747
stringu1 name,
4848
stringu2 name,
4949
string4 name
50-
);
50+
) WITH OIDS;
5151
CREATE TABLE tenk2 (
5252
unique1 int4,
5353
unique2 int4,
@@ -74,7 +74,7 @@ CREATE TABLE person (
7474
CREATE TABLE emp (
7575
salary int4,
7676
manager name
77-
) INHERITS (person);
77+
) INHERITS (person) WITH OIDS;
7878
CREATE TABLE student (
7979
gpa float8
8080
) INHERITS (person);

src/test/regress/expected/errors.out

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ select 1;
1111
--
1212
-- UNSUPPORTED STUFF
1313

14-
-- doesn't work
15-
-- attachas nonesuch
16-
--
1714
-- doesn't work
1815
-- notify pg_class
1916
--

src/test/regress/sql/alter_table.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ drop table atacc1;
348348

349349
-- test unique constraint adding
350350

351-
create table atacc1 ( test int );
351+
create table atacc1 ( test int ) with oids;
352352
-- add a unique constraint
353353
alter table atacc1 add constraint atacc_test1 unique (test);
354354
-- insert first value
@@ -402,7 +402,7 @@ drop table atacc1;
402402

403403
-- test primary key constraint adding
404404

405-
create table atacc1 ( test int );
405+
create table atacc1 ( test int ) with oids;
406406
-- add a primary key constraint
407407
alter table atacc1 add constraint atacc_test1 primary key (test);
408408
-- insert first value
@@ -485,7 +485,7 @@ alter table non_existent alter column bar drop not null;
485485

486486
-- test setting columns to null and not null and vice versa
487487
-- test checking for null values and primary key
488-
create table atacc1 (test int not null);
488+
create table atacc1 (test int not null) with oids;
489489
alter table atacc1 add constraint "atacc1_pkey" primary key (test);
490490
alter table atacc1 alter column test drop not null;
491491
alter table atacc1 drop constraint "atacc1_pkey";
@@ -582,7 +582,7 @@ alter table pg_class drop column relname;
582582
alter table nosuchtable drop column bar;
583583

584584
-- test dropping columns
585-
create table atacc1 (a int4 not null, b int4, c int4 not null, d int4);
585+
create table atacc1 (a int4 not null, b int4, c int4 not null, d int4) with oids;
586586
insert into atacc1 values (1, 2, 3, 4);
587587
alter table atacc1 drop a;
588588
alter table atacc1 drop a;

src/test/regress/sql/copy2.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CREATE TABLE x (
44
c text not null default 'stuff',
55
d text,
66
e text
7-
);
7+
) WITH OIDS;
88

99
CREATE FUNCTION fn_x_before () RETURNS TRIGGER AS '
1010
BEGIN

src/test/regress/sql/create_table.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ CREATE TABLE tenk1 (
5151
stringu1 name,
5252
stringu2 name,
5353
string4 name
54-
);
54+
) WITH OIDS;
5555

5656
CREATE TABLE tenk2 (
5757
unique1 int4,
@@ -83,7 +83,7 @@ CREATE TABLE person (
8383
CREATE TABLE emp (
8484
salary int4,
8585
manager name
86-
) INHERITS (person);
86+
) INHERITS (person) WITH OIDS;
8787

8888

8989
CREATE TABLE student (

src/test/regress/sql/errors.sql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ select 1;
99
--
1010
-- UNSUPPORTED STUFF
1111

12-
-- doesn't work
13-
-- attachas nonesuch
14-
--
1512
-- doesn't work
1613
-- notify pg_class
1714
--

0 commit comments

Comments
 (0)