Skip to content

Commit

Permalink
Add more tests related with #87 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ildus committed Apr 21, 2017
1 parent 389ec25 commit 728c468
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
27 changes: 26 additions & 1 deletion expected/pathman_utility_stmt_hooking.out
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,33 @@ SELECT * FROM copy_stmt_hooking.test ORDER BY val;
6 | hash_2 | 0 | 0
(2 rows)

/* Check dropped colums before partitioning */
CREATE TABLE copy_stmt_hooking.test2 (
a varchar(50),
b varchar(50),
t timestamp without time zone not null
);
ALTER TABLE copy_stmt_hooking.test2 DROP COLUMN a;
SELECT create_range_partitions('copy_stmt_hooking.test2',
't',
'2017-01-01 00:00:00'::timestamp,
interval '1 hour', 5, false
);
NOTICE: sequence "test2_seq" does not exist, skipping
create_range_partitions
-------------------------
5
(1 row)

COPY copy_stmt_hooking.test2(t) FROM stdin;
SELECT COUNT(*) FROM copy_stmt_hooking.test2;
count
-------
1
(1 row)

DROP SCHEMA copy_stmt_hooking CASCADE;
NOTICE: drop cascades to 7 other objects
NOTICE: drop cascades to 798 other objects
/*
* Test auto check constraint renaming
*/
Expand Down
17 changes: 17 additions & 0 deletions sql/pathman_utility_stmt_hooking.sql
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,23 @@ COPY copy_stmt_hooking.test FROM stdin;
SELECT count(*) FROM ONLY copy_stmt_hooking.test;
SELECT * FROM copy_stmt_hooking.test ORDER BY val;

/* Check dropped colums before partitioning */
CREATE TABLE copy_stmt_hooking.test2 (
a varchar(50),
b varchar(50),
t timestamp without time zone not null
);
ALTER TABLE copy_stmt_hooking.test2 DROP COLUMN a;
SELECT create_range_partitions('copy_stmt_hooking.test2',
't',
'2017-01-01 00:00:00'::timestamp,
interval '1 hour', 5, false
);
COPY copy_stmt_hooking.test2(t) FROM stdin;
2017-02-02 20:00:00
\.
SELECT COUNT(*) FROM copy_stmt_hooking.test2;

DROP SCHEMA copy_stmt_hooking CASCADE;


Expand Down

0 comments on commit 728c468

Please sign in to comment.