Skip to content

Commit 69da310

Browse files
committed
Merge branch 'master' into picky_nodes
2 parents 849b833 + 2775b5a commit 69da310

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

range.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,15 @@ DECLARE
912912
v_cond TEXT;
913913
v_plain_partname TEXT;
914914
v_plain_schema TEXT;
915+
rel_persistence CHAR;
915916
BEGIN
917+
/* Ignore temporary tables */
918+
SELECT relpersistence FROM pg_catalog.pg_class WHERE oid = p_partition INTO rel_persistence;
919+
IF rel_persistence = 't'::CHAR THEN
920+
RAISE EXCEPTION 'Temporary table % cannot be used as a partition',
921+
quote_ident(p_partition::TEXT);
922+
END IF;
923+
916924
/* Prevent concurrent partition management */
917925
PERFORM @extschema@.acquire_partitions_lock();
918926

0 commit comments

Comments
 (0)