Add specific regression tests for pg10- versions

This commit is contained in:
Julien Rouhaud 2018-11-17 12:01:11 +01:00
parent 777b757c18
commit 3a18286a5c
3 changed files with 55 additions and 3 deletions

View file

@ -1,10 +1,11 @@
EXTENSION = hypopg
EXTVERSION = $(shell grep default_version $(EXTENSION).control | sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
TESTS = $(wildcard test/sql/*.sql)
# more test are added later, after including pgxs
REGRESS = hypo_setup \
hypo_index \
hypo_table \
hypo_index_table
hypo_index
REGRESS_OPTS = --inputdir=test
@ -32,6 +33,13 @@ DATA = $(wildcard *--*.sql)
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
ifeq ($(MAJORVERSION),$(filter $(MAJORVERSION),9.2 9.3 9.4 9.5 9.6))
REGRESS += hypo_no_table
else
REGRESS += hypo_table \
hypo_index_table
endif
DEBUILD_ROOT = /tmp/$(EXTENSION)
deb: release-zip

View file

@ -0,0 +1,28 @@
-- Test for pg versions that don't support declarative partitioning
-- ================================================================
-- 0. Dropping any hypothetical object
SELECT * FROM hypopg_reset();
hypopg_reset
--------------
(1 row)
-- 1. partition test
CREATE TABLE hypo_part_range (id integer, val text);
SELECT * FROM hypopg_partition_table('hypo_part_range', 'PARTITION BY RANGE (id)');
ERROR: hypopg: Hypothetical partitioning requires PostgreSQl 10 or above
SELECT tablename FROM hypopg_add_partition('hypo_part_range_1_10000', 'PARTITION OF hypo_part_range FOR VALUES FROM (1) TO (10000)');
ERROR: hypopg: Hypothetical partitioning requires PostgreSQl 10 or above
-- 2. other functions
SELECT * FROM hypopg_reset_table();
ERROR: hypopg: Hypothetical partitioning requires PostgreSQl 10 or above
SELECT * FROM hypopg_drop_table('hypo_part_range'::regclass);
ERROR: hypopg: Hypothetical partitioning requires PostgreSQl 10 or above
SELECT * FROM hypopg_table();
ERROR: hypopg: Hypothetical partitioning requires PostgreSQl 10 or above
SELECT * FROM hypopg_analyze('hypo_part_range');
ERROR: hypopg: Hypothetical partitioning requires PostgreSQl 10 or above
SELECT * FROM hypopg_statistic();
ERROR: hypopg: Hypothetical partitioning requires PostgreSQl 10 or above
SELECT * FROM hypopg_stats;
ERROR: hypopg: Hypothetical partitioning requires PostgreSQl 10 or above

View file

@ -0,0 +1,16 @@
-- Test for pg versions that don't support declarative partitioning
-- ================================================================
-- 0. Dropping any hypothetical object
SELECT * FROM hypopg_reset();
-- 1. partition test
CREATE TABLE hypo_part_range (id integer, val text);
SELECT * FROM hypopg_partition_table('hypo_part_range', 'PARTITION BY RANGE (id)');
SELECT tablename FROM hypopg_add_partition('hypo_part_range_1_10000', 'PARTITION OF hypo_part_range FOR VALUES FROM (1) TO (10000)');
-- 2. other functions
SELECT * FROM hypopg_reset_table();
SELECT * FROM hypopg_drop_table('hypo_part_range'::regclass);
SELECT * FROM hypopg_table();
SELECT * FROM hypopg_analyze('hypo_part_range');
SELECT * FROM hypopg_statistic();
SELECT * FROM hypopg_stats;