Skip to content

Commit 07ad611

Browse files
committed
added some tests for callbacks
1 parent 2b0bfab commit 07ad611

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 to 8 other objects
133+
NOTICE: drop cascades to 2 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+
DROP TABLE callbacks.abc CASCADE;
47+
48+
/* create table in public schema */
49+
CREATE TABLE abc(a serial, b int);
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+
DROP TABLE abc CASCADE;
4655

4756
DROP SCHEMA callbacks CASCADE;
4857
DROP EXTENSION pg_pathman CASCADE;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy