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

Commit16810d9

Browse files
committed
Revisit pathman readiness again.
Most pathman functions break if pathman is disabled: earlier I put defensechecks in split and merge range partitions, now it isdrop_range_partition_expand_next. Looks like the reason is that pathman cachesare not being invalidated if it is disabled: pathman_relcache_hook exits rightaway then. This is kinda reasonable: if we want to disable pathman completely,why maintain the caches? So this time try to bury the readiness check deeper,in get_pathman_relation_info itself.BTW, pathman caches are not dropped when it is disabled, which looks suspiciouson its own -- probably if we re-enable it later, caches might be inconsistent.
1 parentd1032b0 commit16810d9

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

‎expected/pathman_calamity.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ ERROR: pg_pathman is disabled
10091009
SELECT * FROM pathman_partition_list;/* not ok */
10101010
ERROR: pg_pathman is not initialized yet
10111011
SELECT get_part_range('calamity.survivor', 0, NULL::INT);/* not ok */
1012-
ERROR: pg_pathman isnot initialized yet
1012+
ERROR: pg_pathman isdisabled
10131013
EXPLAIN (COSTS OFF) SELECT * FROM calamity.survivor;/* OK */
10141014
QUERY PLAN
10151015
------------------------------

‎src/pl_range_funcs.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,6 @@ split_range_partition(PG_FUNCTION_ARGS)
489489
char*query;
490490
inti;
491491

492-
if (!IsPathmanReady())
493-
elog(ERROR,"pg_pathman is disabled");
494-
495492
if (!PG_ARGISNULL(0))
496493
{
497494
partition1=PG_GETARG_OID(0);
@@ -655,9 +652,6 @@ merge_range_partitions(PG_FUNCTION_ARGS)
655652
FmgrInfofinfo;
656653
inti;
657654

658-
if (!IsPathmanReady())
659-
elog(ERROR,"pg_pathman is disabled");
660-
661655
/* Validate array type */
662656
Assert(ARR_ELEMTYPE(arr)==REGCLASSOID);
663657

‎src/relation_info.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ get_pathman_relation_info(Oid relid)
320320
{
321321
PartStatusInfo*psin;
322322

323+
if (!IsPathmanReady())
324+
elog(ERROR,"pg_pathman is disabled");
325+
323326
/* Should always be called in transaction */
324327
Assert(IsTransactionState());
325328

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp