Skip to content

Commit 86d609a

Browse files
committed
_partition_data_concurrent() should not be STRICT, fix ARGISNULL 'else if' checks in invoke_on_partition_created_callback()
1 parent 1385218 commit 86d609a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

init.sql

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ DECLARE
198198
v_limit_clause TEXT := '';
199199
v_where_clause TEXT := '';
200200
ctids TID[];
201+
201202
BEGIN
202203
SELECT attname INTO v_attr
203204
FROM @extschema@.pathman_config WHERE partrel = p_relation;
@@ -244,7 +245,7 @@ BEGIN
244245
RETURN;
245246
END
246247
$$
247-
LANGUAGE plpgsql STRICT
248+
LANGUAGE plpgsql
248249
SET pg_pathman.enable_partitionfilter = on; /* ensures that PartitionFilter is ON */
249250

250251
/*
@@ -708,8 +709,9 @@ CREATE OR REPLACE FUNCTION @extschema@.validate_on_partition_created_callback(ca
708709
RETURNS VOID AS 'pg_pathman', 'validate_on_part_init_callback_pl'
709710
LANGUAGE C STRICT;
710711

712+
711713
/*
712-
* Builds JSONB object containing new partition parameters and invoke the callback.
714+
* Invoke init_callback on RANGE partition.
713715
*/
714716
CREATE OR REPLACE FUNCTION @extschema@.invoke_on_partition_created_callback(
715717
parent_relid REGCLASS,
@@ -720,6 +722,9 @@ CREATE OR REPLACE FUNCTION @extschema@.invoke_on_partition_created_callback(
720722
RETURNS VOID AS 'pg_pathman', 'invoke_on_partition_created_callback'
721723
LANGUAGE C;
722724

725+
/*
726+
* Invoke init_callback on HASH partition.
727+
*/
723728
CREATE OR REPLACE FUNCTION @extschema@.invoke_on_partition_created_callback(
724729
parent_relid REGCLASS,
725730
partition REGCLASS,

src/pl_funcs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ invoke_on_partition_created_callback(PG_FUNCTION_ARGS)
844844
part_type = PT_HASH;
845845

846846
/* Either RANGE_START or RANGE_END is missing */
847-
if (PG_ARGISNULL(ARG_RANGE_START) || PG_ARGISNULL(ARG_RANGE_START))
847+
else if (PG_ARGISNULL(ARG_RANGE_START) || PG_ARGISNULL(ARG_RANGE_START))
848848
elog(ERROR, "both boundaries must be provided for RANGE partition");
849849

850850
/* Both RANGE_START & RANGE_END are provided */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy