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

Commit2775b5a

Browse files
committed
prohibit usage of temporary tables as partitions
1 parent8b14f73 commit2775b5a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎range.sql

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ END
328328
$$ LANGUAGE plpgsql;
329329

330330
/*
331-
*
331+
*
332332
*/
333333
CREATEOR REPLACE FUNCTION @extschema@.check_boundaries(
334334
p_relation REGCLASS
@@ -706,7 +706,7 @@ BEGIN
706706
FROM @extschema@.pathman_configWHERE relname::regclass= p_relation;
707707

708708
v_atttype := @extschema@.get_attribute_type_name(p_relation, v_attname);
709-
709+
710710
EXECUTE format('SELECT @extschema@.append_partition_internal($1, $2, $3, ARRAY[]::%s[])', v_atttype)
711711
INTO v_part_name
712712
USING p_relation, v_atttype, v_interval;
@@ -918,7 +918,15 @@ DECLARE
918918
v_condTEXT;
919919
v_plain_partnameTEXT;
920920
v_plain_schemaTEXT;
921+
rel_persistenceCHAR;
921922
BEGIN
923+
/* Ignore temporary tables*/
924+
SELECT relpersistenceFROMpg_catalog.pg_classWHEREoid= p_partition INTO rel_persistence;
925+
IF rel_persistence='t'::CHAR THEN
926+
RAISE EXCEPTION'Temporary table % cannot be used as a partition',
927+
quote_ident(p_partition::TEXT);
928+
END IF;
929+
922930
/* Prevent concurrent partition management*/
923931
PERFORM @extschema@.acquire_partitions_lock();
924932

@@ -1086,7 +1094,7 @@ DECLARE
10861094
EXECUTE q USING %7$s;
10871095
RETURN NULL;
10881096
END $body$ LANGUAGE plpgsql';
1089-
triggerTEXT :='CREATE TRIGGER %s_update_trigger'||
1097+
triggerTEXT :='CREATE TRIGGER %s_update_trigger'||
10901098
'BEFORE UPDATE ON %s'||
10911099
'FOR EACH ROW EXECUTE PROCEDURE %s_update_trigger_func()';
10921100
att_namesTEXT;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp