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

Commit 7e22540

Browse files
committed
add test case for DROP INDEX CONCURRENTLY
1 parent 86e280c commit 7e22540

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

expected/pathman_calamity.out

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,25 @@ SELECT context, entries FROM pathman_cache_stats ORDER BY context; /* OK */
10431043

10441044
DROP SCHEMA calamity CASCADE;
10451045
DROP EXTENSION pg_pathman;
1046+
/*
1047+
* -----------------------------------------------------------
1048+
* Special tests (drop index concurrently to test snapshots)
1049+
* -----------------------------------------------------------
1050+
*/
1051+
CREATE SCHEMA calamity;
1052+
CREATE EXTENSION pg_pathman;
1053+
CREATE TABLE calamity.drop_index (val INT4 NOT NULL);
1054+
CREATE INDEX ON calamity.drop_index (val);
1055+
SELECT create_hash_partitions('calamity.drop_index', 'val', 2);
1056+
create_hash_partitions
1057+
------------------------
1058+
2
1059+
(1 row)
1060+
1061+
DROP INDEX CONCURRENTLY calamity.drop_index_0_val_idx;
1062+
DROP SCHEMA calamity CASCADE;
1063+
NOTICE: drop cascades to 3 other objects
1064+
DROP EXTENSION pg_pathman;
10461065
/*
10471066
* ------------------------------------------
10481067
* Special tests (uninitialized pg_pathman)

sql/pathman_calamity.sql

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,25 @@ DROP EXTENSION pg_pathman;
422422

423423

424424

425+
/*
426+
* -----------------------------------------------------------
427+
* Special tests (drop index concurrently to test snapshots)
428+
* -----------------------------------------------------------
429+
*/
430+
431+
CREATE SCHEMA calamity;
432+
CREATE EXTENSION pg_pathman;
433+
434+
CREATE TABLE calamity.drop_index (val INT4 NOT NULL);
435+
CREATE INDEX ON calamity.drop_index (val);
436+
SELECT create_hash_partitions('calamity.drop_index', 'val', 2);
437+
DROP INDEX CONCURRENTLY calamity.drop_index_0_val_idx;
438+
439+
DROP SCHEMA calamity CASCADE;
440+
DROP EXTENSION pg_pathman;
441+
442+
443+
425444
/*
426445
* ------------------------------------------
427446
* Special tests (uninitialized pg_pathman)

0 commit comments

Comments
 (0)