Skip to content

Commit 9472ae0

Browse files
committed
pathman: isolation tests (not finished)
1 parent 8541cbb commit 9472ae0

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

contrib/pg_pathman/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ DATA_built = $(EXTENSION)--$(EXTVERSION).sql
99
PGFILEDESC = "pg_pathman - partitioning tool"
1010

1111
REGRESS = pg_pathman
12-
EXTRA_CLEAN = $(EXTENSION)--$(EXTVERSION).sql
12+
EXTRA_CLEAN = $(EXTENSION)--$(EXTVERSION).sql ./isolation_output
1313

1414
ifdef USE_PGXS
1515
PG_CONFIG = pg_config
@@ -25,3 +25,12 @@ endif
2525
$(EXTENSION)--$(EXTVERSION).sql: init.sql hash.sql range.sql
2626
cat $^ > $@
2727
check: EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add
28+
29+
ISOLATIONCHECKS=insert_trigger
30+
31+
isolationcheck:
32+
$(MKDIR_P) isolation_output
33+
$(pg_isolation_regress_check) \
34+
--temp-config=$(top_srcdir)/$(subdir)/conf.add \
35+
--outputdir=./isolation_output \
36+
$(ISOLATIONCHECKS)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
setup
2+
{
3+
--SELECT '>>> SETUP <<<';
4+
CREATE EXTENSION pg_pathman;
5+
CREATE TABLE range_rel(id serial primary key);
6+
SELECT create_range_partitions('range_rel', 'id', 1, 100, 1);
7+
}
8+
9+
teardown
10+
{
11+
--SELECT '>>> TEARDOWN <<<';
12+
--SELECT drop_range_partitions('range_rel');
13+
DROP TABLE range_rel CASCADE;
14+
DROP EXTENSION pg_pathman;
15+
}
16+
17+
session "s1"
18+
step "s1i" { INSERT INTO range_rel SELECT generate_series(1, 150); }
19+
step "s1d" { SELECT * FROM pg_inherits WHERE inhparent = 'range_rel'::regclass::oid; }
20+
21+
session "s2"
22+
step "s2i" { INSERT INTO range_rel SELECT generate_series(151, 300); }

0 commit comments

Comments
 (0)