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

Commit7d39ce5

Browse files
committed
other fixes to migration script
1 parent6192af7 commit7d39ce5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

‎pg_pathman--1.3--1.4.sql

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ DROP FUNCTION @extschema@.on_create_partitions(REGCLASS);
8989
DROPFUNCTION @extschema@.on_update_partitions(REGCLASS);
9090
DROPFUNCTION @extschema@.on_remove_partitions(REGCLASS);
9191
DROPFUNCTION @extschema@.is_attribute_nullable(REGCLASS,TEXT);
92+
DROPFUNCTION @extschema@.build_check_constraint_name(REGCLASS,TEXT);
9293
DROPFUNCTION @extschema@.build_check_constraint_name(REGCLASS, INT2);
9394
DROPFUNCTION @extschema@.add_to_pathman_config(REGCLASS,TEXT,TEXT);
9495
DROPFUNCTION @extschema@.lock_partitioned_relation(REGCLASS);
@@ -257,6 +258,31 @@ END
257258
$$ LANGUAGE plpgsql;
258259

259260

261+
CREATEOR REPLACE FUNCTION @extschema@.pathman_ddl_trigger_func()
262+
RETURNS event_triggerAS $$
263+
DECLARE
264+
objRECORD;
265+
pg_class_oidOID;
266+
relidsREGCLASS[];
267+
268+
BEGIN
269+
pg_class_oid='pg_catalog.pg_class'::regclass;
270+
271+
/* Find relids to remove from config*/
272+
SELECT array_agg(cfg.partrel) INTO relids
273+
FROM pg_event_trigger_dropped_objects()AS events
274+
JOIN @extschema@.pathman_configAS cfgONcfg.partrel::oid=events.objid
275+
WHEREevents.classid= pg_class_oidANDevents.objsubid=0;
276+
277+
/* Cleanup pathman_config*/
278+
DELETEFROM @extschema@.pathman_configWHERE partrel= ANY(relids);
279+
280+
/* Cleanup params table too*/
281+
DELETEFROM @extschema@.pathman_config_paramsWHERE partrel= ANY(relids);
282+
END
283+
$$ LANGUAGE plpgsql;
284+
285+
260286
CREATEOR REPLACE FUNCTION @extschema@.create_naming_sequence(
261287
parent_relidREGCLASS)
262288
RETURNSTEXTAS $$

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp