Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfe70668

Browse files
committed
Add test files for declarative syntax
1 parent722ddb0 commitfe70668

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

‎Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,15 @@ EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add
6767

6868
EXTRA_CLEAN = pg_pathman--$(EXTVERSION).sql ./isolation_output
6969

70+
DECL_CHECK_VERSIONS = 10beta1
71+
7072
ifdefUSE_PGXS
7173
PG_CONFIG = pg_config
7274
PGXS :=$(shell$(PG_CONFIG) --pgxs)
75+
VNUM :=$(shell$(PG_CONFIG) --version | awk '{print $$2}')
76+
ifeq ($(VNUM),$(filter$(VNUM),$(DECL_CHECK_VERSIONS)))
77+
REGRESS += pathman_declarative
78+
endif
7379
include$(PGXS)
7480
else
7581
subdir = contrib/pg_pathman

‎expected/pathman_declarative.out

Whitespace-only changes.

‎sql/pathman_declarative.sql

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
\set VERBOSITY terse
2+
3+
SET search_path='public';
4+
CREATESCHEMApathman;
5+
CREATE EXTENSION pg_pathman SCHEMA pathman;
6+
CREATESCHEMAtest;
7+
8+
CREATETABLEtest.range_rel (
9+
idSERIALPRIMARY KEY,
10+
dtDATENOT NULL
11+
);
12+
13+
INSERT INTOtest.range_rel (dt)
14+
SELECT gFROM generate_series('2015-01-01','2015-04-30','1 day'::interval)AS g;
15+
SELECTpathman.create_range_partitions('test.range_rel','dt',
16+
'2015-01-01'::DATE,'1 month'::INTERVAL);
17+
18+
SELECT*FROM pathman_partition_list;
19+
CREATETABLEtest.r2LIKE (test.range_rel);
20+
ALTERTABLEtest.range_rel ATTACH PARTITIONtest.r2
21+
FORVALUESFROM ('2015-05-01') TO ('2015-06-01');
22+
SELECT*FROM pathman_partition_list;
23+
\d+test.r2;
24+
ALTERTABLEtest.range_rel DETACH PARTITIONtest.r2;
25+
SELECT*FROM pathman_partition_list;
26+
\d+test.r2;
27+
28+
DROPSCHEMA test CASCADE;
29+
DROP EXTENSION pg_pathman CASCADE;
30+
DROPSCHEMA pathman CASCADE;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp