Skip to content

Commit ad70cfa

Browse files
committed
Append pg_catalog to some more places, fix again _partition_data_concurrent.
1 parent 4d78bcd commit ad70cfa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

init.sql

+5-5
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ BEGIN
188188
IF callback != 0 THEN
189189
SELECT pg_catalog.quote_ident(nspname) || '.' ||
190190
pg_catalog.quote_ident(proname) || '(' ||
191-
(SELECT string_agg(x.argtype::REGTYPE::TEXT, ',')
192-
FROM unnest(proargtypes) AS x(argtype)) ||
191+
(SELECT pg_catalog.string_agg(x.argtype::REGTYPE::TEXT, ',')
192+
FROM pg_catalog.unnest(proargtypes) AS x(argtype)) ||
193193
')'
194194
FROM pg_catalog.pg_proc p JOIN pg_catalog.pg_namespace n
195195
ON n.oid = p.pronamespace
@@ -455,7 +455,7 @@ BEGIN
455455
RAISE EXCEPTION 'table "%" has already been partitioned', parent_relid;
456456
END IF;
457457

458-
IF EXISTS (SELECT 1 FROM pg_inherits WHERE inhparent = parent_relid) THEN
458+
IF EXISTS (SELECT 1 FROM pg_catalog.pg_inherits WHERE inhparent = parent_relid) THEN
459459
RAISE EXCEPTION 'can''t partition table "%" with existing children', parent_relid;
460460
END IF;
461461

@@ -506,7 +506,7 @@ BEGIN
506506

507507
/* Find relids to remove from config */
508508
SELECT pg_catalog.array_agg(cfg.partrel) INTO relids
509-
FROM pg_event_trigger_dropped_objects() AS events
509+
FROM pg_catalog.pg_event_trigger_dropped_objects() AS events
510510
JOIN @[email protected]_config AS cfg ON cfg.partrel::oid = events.objid
511511
WHERE events.classid = pg_class_oid AND events.objsubid = 0;
512512

@@ -707,7 +707,7 @@ CREATE FUNCTION @[email protected]_number_of_partitions(
707707
parent_relid REGCLASS)
708708
RETURNS INT4 AS
709709
$$
710-
SELECT count(*)::INT4
710+
SELECT pg_catalog.count(*)::INT4
711711
FROM pg_catalog.pg_inherits
712712
WHERE inhparent = parent_relid;
713713
$$

src/pathman_workers.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ bgw_main_concurrent_part(Datum main_arg)
523523
* context will be destroyed after transaction finishes
524524
*/
525525
current_mcxt = MemoryContextSwitchTo(TopPathmanContext);
526-
sql = psprintf("SELECT %s._partition_data_concurrent($1::oid, NULL::text, NULL::text, p_limit:=$2)",
526+
sql = psprintf("SELECT %s._partition_data_concurrent($1::regclass, NULL::text, NULL::text, p_limit:=$2)",
527527
get_namespace_name(get_pathman_schema()));
528528
MemoryContextSwitchTo(current_mcxt);
529529
}

0 commit comments

Comments
 (0)