From 728c468e1b9092da12f6cc29319119ed19e49691 Mon Sep 17 00:00:00 2001 From: Ildus K Date: Fri, 21 Apr 2017 15:25:33 +0300 Subject: [PATCH] Add more tests related with #87 issue --- expected/pathman_utility_stmt_hooking.out | 27 ++++++++++++++++++++++- sql/pathman_utility_stmt_hooking.sql | 17 ++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/expected/pathman_utility_stmt_hooking.out b/expected/pathman_utility_stmt_hooking.out index f6642d1b..db7f0d7a 100644 --- a/expected/pathman_utility_stmt_hooking.out +++ b/expected/pathman_utility_stmt_hooking.out @@ -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 */ diff --git a/sql/pathman_utility_stmt_hooking.sql b/sql/pathman_utility_stmt_hooking.sql index 15367b86..5fb6665b 100644 --- a/sql/pathman_utility_stmt_hooking.sql +++ b/sql/pathman_utility_stmt_hooking.sql @@ -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;