Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2e174ba

Browse files
committed
[PGPRO-5255] fix tests for postgres 9.5 and 10
1 parent 98b1f18 commit 2e174ba

5 files changed

+10
-10
lines changed

expected/pathman_declarative.out

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ Check constraints:
9494
"pathman_r4_check" CHECK (dt >= '06-01-2015'::date AND dt < '01-01-2016'::date)
9595
Inherits: test.range_rel
9696

97-
ALTER TABLE IF EXISTS test.nonexistent_table ATTACH PARTITION baz DEFAULT;
97+
/* Note: PG-10 doesn't support ATTACH PARTITION ... DEFAULT */
98+
ALTER TABLE IF EXISTS test.nonexistent_table ATTACH PARTITION baz FOR VALUES IN (42);
9899
NOTICE: relation "nonexistent_table" does not exist, skipping
99100
ALTER TABLE IF EXISTS test.nonexistent_table DETACH PARTITION baz;
100101
NOTICE: relation "nonexistent_table" does not exist, skipping

expected/pathman_declarative_1.out

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ Check constraints:
9494
"pathman_r4_check" CHECK (dt >= '06-01-2015'::date AND dt < '01-01-2016'::date)
9595
Inherits: test.range_rel
9696

97-
ALTER TABLE IF EXISTS test.nonexistent_table ATTACH PARTITION baz DEFAULT;
97+
/* Note: PG-10 doesn't support ATTACH PARTITION ... DEFAULT */
98+
ALTER TABLE IF EXISTS test.nonexistent_table ATTACH PARTITION baz FOR VALUES IN (42);
9899
NOTICE: relation "nonexistent_table" does not exist, skipping
99100
ALTER TABLE IF EXISTS test.nonexistent_table DETACH PARTITION baz;
100101
NOTICE: relation "nonexistent_table" does not exist, skipping

expected/pathman_utility_stmt.out

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,10 @@ CREATE SCHEMA test_nonexistance;
377377
ALTER TABLE IF EXISTS test_nonexistance.nonexistent_table RENAME TO other_table_name;
378378
NOTICE: relation "nonexistent_table" does not exist, skipping
379379
/* renaming existent tables already tested earlier (see rename.plain_test) */
380-
ALTER TABLE IF EXISTS test_nonexistance.nonexistent_table ADD COLUMN IF NOT EXISTS j INT4;
380+
ALTER TABLE IF EXISTS test_nonexistance.nonexistent_table ADD COLUMN j INT4;
381381
NOTICE: relation "nonexistent_table" does not exist, skipping
382382
CREATE TABLE test_nonexistance.existent_table(i INT4);
383-
ALTER TABLE IF EXISTS test_nonexistance.existent_table ADD COLUMN IF NOT EXISTS i INT4;
384-
NOTICE: column "i" of relation "existent_table" already exists, skipping
385-
ALTER TABLE IF EXISTS test_nonexistance.existent_table ADD COLUMN IF NOT EXISTS j INT4;
383+
ALTER TABLE IF EXISTS test_nonexistance.existent_table ADD COLUMN j INT4;
386384
SELECT attname FROM pg_attribute WHERE attnum > 0 AND attrelid = 'test_nonexistance.existent_table'::REGCLASS;
387385
attname
388386
---------

sql/pathman_declarative.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ CREATE TABLE test.r4 PARTITION OF test.range_rel
3939
FOR VALUES FROM ('2015-06-01') TO ('2016-01-01');
4040
\d+ test.r4;
4141

42-
ALTER TABLE IF EXISTS test.nonexistent_table ATTACH PARTITION baz DEFAULT;
42+
/* Note: PG-10 doesn't support ATTACH PARTITION ... DEFAULT */
43+
ALTER TABLE IF EXISTS test.nonexistent_table ATTACH PARTITION baz FOR VALUES IN (42);
4344
ALTER TABLE IF EXISTS test.nonexistent_table DETACH PARTITION baz;
4445

4546
DROP SCHEMA test CASCADE;

sql/pathman_utility_stmt.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,9 @@ CREATE SCHEMA test_nonexistance;
258258
ALTER TABLE IF EXISTS test_nonexistance.nonexistent_table RENAME TO other_table_name;
259259
/* renaming existent tables already tested earlier (see rename.plain_test) */
260260

261-
ALTER TABLE IF EXISTS test_nonexistance.nonexistent_table ADD COLUMN IF NOT EXISTS j INT4;
261+
ALTER TABLE IF EXISTS test_nonexistance.nonexistent_table ADD COLUMN j INT4;
262262
CREATE TABLE test_nonexistance.existent_table(i INT4);
263-
ALTER TABLE IF EXISTS test_nonexistance.existent_table ADD COLUMN IF NOT EXISTS i INT4;
264-
ALTER TABLE IF EXISTS test_nonexistance.existent_table ADD COLUMN IF NOT EXISTS j INT4;
263+
ALTER TABLE IF EXISTS test_nonexistance.existent_table ADD COLUMN j INT4;
265264
SELECT attname FROM pg_attribute WHERE attnum > 0 AND attrelid = 'test_nonexistance.existent_table'::REGCLASS;
266265
DROP TABLE test_nonexistance.existent_table;
267266

0 commit comments

Comments
 (0)