Provide a better error message for misplaced dispatch options.
[pgsql.git] / src / test / modules / injection_points / sql / reindex_conc.sql
blob6cf211e6d5dd0cf1d099a8821a7d1cd429c55095
1 -- Tests for REINDEX CONCURRENTLY
2 CREATE EXTENSION injection_points;
4 -- Check safety of indexes with predicates and expressions.
5 SELECT injection_points_set_local();
6 SELECT injection_points_attach('reindex-conc-index-safe', 'notice');
7 SELECT injection_points_attach('reindex-conc-index-not-safe', 'notice');
9 CREATE SCHEMA reindex_inj;
10 CREATE TABLE reindex_inj.tbl(i int primary key, updated_at timestamp);
12 CREATE UNIQUE INDEX ind_simple ON reindex_inj.tbl(i);
13 CREATE UNIQUE INDEX ind_expr ON reindex_inj.tbl(ABS(i));
14 CREATE UNIQUE INDEX ind_pred ON reindex_inj.tbl(i) WHERE mod(i, 2) = 0;
15 CREATE UNIQUE INDEX ind_expr_pred ON reindex_inj.tbl(abs(i)) WHERE mod(i, 2) = 0;
17 REINDEX INDEX CONCURRENTLY reindex_inj.ind_simple;
18 REINDEX INDEX CONCURRENTLY reindex_inj.ind_expr;
19 REINDEX INDEX CONCURRENTLY reindex_inj.ind_pred;
20 REINDEX INDEX CONCURRENTLY reindex_inj.ind_expr_pred;
22 -- Cleanup
23 SELECT injection_points_detach('reindex-conc-index-safe');
24 SELECT injection_points_detach('reindex-conc-index-not-safe');
25 DROP TABLE reindex_inj.tbl;
26 DROP SCHEMA reindex_inj;
28 DROP EXTENSION injection_points;