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

Commit07ad611

Browse files
committed
added some tests for callbacks
1 parent2b0bfab commit07ad611

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

‎expected/pathman_callbacks.out

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,28 @@ WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_4",
107107
5
108108
(1 row)
109109

110+
DROP TABLE callbacks.abc CASCADE;
111+
NOTICE: drop cascades to 5 other objects
112+
/* create table in public schema */
113+
CREATE TABLE abc(a serial, b int);
114+
SELECT set_init_callback('abc',
115+
'callbacks.abc_on_part_created_callback');
116+
set_init_callback
117+
-------------------
118+
119+
(1 row)
120+
121+
SELECT create_range_partitions('abc', 'a', 1, 100, 2);
122+
NOTICE: sequence "abc_seq" does not exist, skipping
123+
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_1", "range_max": "101", "range_min": "1", "parent_schema": "public", "partition_schema": "public"}
124+
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_2", "range_max": "201", "range_min": "101", "parent_schema": "public", "partition_schema": "public"}
125+
create_range_partitions
126+
-------------------------
127+
2
128+
(1 row)
129+
130+
DROP TABLE abc CASCADE;
131+
NOTICE: drop cascades to 2 other objects
110132
DROP SCHEMA callbacks CASCADE;
111-
NOTICE: drop cascades to8 other objects
133+
NOTICE: drop cascades to2 other objects
112134
DROP EXTENSION pg_pathman CASCADE;

‎sql/pathman_callbacks.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ SELECT set_init_callback('callbacks.abc',
4343
'callbacks.abc_on_part_created_callback');
4444
SELECT create_hash_partitions('callbacks.abc','a',5);
4545

46+
DROPTABLEcallbacks.abc CASCADE;
47+
48+
/* create table in public schema*/
49+
CREATETABLEabc(aserial, bint);
50+
SELECT set_init_callback('abc',
51+
'callbacks.abc_on_part_created_callback');
52+
SELECT create_range_partitions('abc','a',1,100,2);
53+
54+
DROPTABLE abc CASCADE;
4655

4756
DROPSCHEMA callbacks CASCADE;
4857
DROP EXTENSION pg_pathman CASCADE;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp