File tree 2 files changed +43
-1
lines changed
2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -256,8 +256,33 @@ SELECT * FROM copy_stmt_hooking.test ORDER BY val;
256
256
6 | hash_2 | 0 | 0
257
257
(2 rows)
258
258
259
+ /* Check dropped colums before partitioning */
260
+ CREATE TABLE copy_stmt_hooking.test2 (
261
+ a varchar(50),
262
+ b varchar(50),
263
+ t timestamp without time zone not null
264
+ );
265
+ ALTER TABLE copy_stmt_hooking.test2 DROP COLUMN a;
266
+ SELECT create_range_partitions('copy_stmt_hooking.test2',
267
+ 't',
268
+ '2017-01-01 00:00:00'::timestamp,
269
+ interval '1 hour', 5, false
270
+ );
271
+ NOTICE: sequence "test2_seq" does not exist, skipping
272
+ create_range_partitions
273
+ -------------------------
274
+ 5
275
+ (1 row)
276
+
277
+ COPY copy_stmt_hooking.test2(t) FROM stdin;
278
+ SELECT COUNT(*) FROM copy_stmt_hooking.test2;
279
+ count
280
+ -------
281
+ 1
282
+ (1 row)
283
+
259
284
DROP SCHEMA copy_stmt_hooking CASCADE;
260
- NOTICE: drop cascades to 7 other objects
285
+ NOTICE: drop cascades to 798 other objects
261
286
/*
262
287
* Test auto check constraint renaming
263
288
*/
Original file line number Diff line number Diff line change @@ -139,6 +139,23 @@ COPY copy_stmt_hooking.test FROM stdin;
139
139
SELECT count (* ) FROM ONLY copy_stmt_hooking .test ;
140
140
SELECT * FROM copy_stmt_hooking .test ORDER BY val;
141
141
142
+ /* Check dropped colums before partitioning */
143
+ CREATE TABLE copy_stmt_hooking .test2 (
144
+ a varchar (50 ),
145
+ b varchar (50 ),
146
+ t timestamp without time zone not null
147
+ );
148
+ ALTER TABLE copy_stmt_hooking .test2 DROP COLUMN a;
149
+ SELECT create_range_partitions(' copy_stmt_hooking.test2' ,
150
+ ' t' ,
151
+ ' 2017-01-01 00:00:00' ::timestamp ,
152
+ interval ' 1 hour' , 5 , false
153
+ );
154
+ COPY copy_stmt_hooking .test2 (t) FROM stdin;
155
+ 2017 - 02 - 02 20 :00 :00
156
+ \.
157
+ SELECT COUNT (* ) FROM copy_stmt_hooking .test2 ;
158
+
142
159
DROP SCHEMA copy_stmt_hooking CASCADE;
143
160
144
161
You can’t perform that action at this time.
0 commit comments