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

Commit951cde1

Browse files
committed
restrict partitioning of temporary tables
1 parent46115f9 commit951cde1

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

‎hash.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ BEGIN
6969
PERFORM @extschema@.partition_data(parent_relid);
7070

7171
RETURN partitions_count;
72+
73+
EXCEPTION WHEN others THEN
74+
RAISE EXCEPTION'%', SQLERRM;
7275
END
7376
$$ LANGUAGE plpgsql
7477
SET client_min_messages= WARNING;

‎init.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,18 @@ $$
8888
DECLARE
8989
v_recRECORD;
9090
is_referencedBOOLEAN;
91+
rel_persistenceCHAR;
9192

9293
BEGIN
94+
/* Ignore temporary tables*/
95+
SELECT relpersistenceFROMpg_catalog.pg_class
96+
WHEREoid= p_relation INTO rel_persistence;
97+
98+
IF rel_persistence='t'::CHAR THEN
99+
RAISE EXCEPTION'Temporary table "%" cannot be partitioned',
100+
quote_ident(p_relation::TEXT);
101+
END IF;
102+
93103
IF EXISTS (SELECT*FROM @extschema@.pathman_config
94104
WHERE partrel= p_relation) THEN
95105
RAISE EXCEPTION'Relation "%" has already been partitioned', p_relation;

‎range.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ BEGIN
875875
WHEREoid= p_partition INTO rel_persistence;
876876

877877
IF rel_persistence='t'::CHAR THEN
878-
RAISE EXCEPTION'Temporary table\"%\" cannot be used as a partition',
878+
RAISE EXCEPTION'Temporary table"%" cannot be used as a partition',
879879
quote_ident(p_partition::TEXT);
880880
END IF;
881881

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp