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

Commit3b5f4f1

Browse files
committed
Fail BRIN control functions during recovery explicitly
They already fail anyway, but prior to this patch they raise an uglyerror message about a lock that cannot be acquired. This just improvesthe message.Author: Masahiko SawadaReported-by: Masahiko SawadaDiscussion:https://postgr.es/m/CAD21AoBZau4g4_NUf3BKNd=CdYK+xaPdtJCzvOC1TxGdTiJx_Q@mail.gmail.comReviewed-by: Kuntal Ghosh, Alexander Korotkov, Simon Riggs, Michaël Paquier, Álvaro Herrera
1 parent476ba1e commit3b5f4f1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/backend/access/brin/brin.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,12 @@ brin_summarize_range(PG_FUNCTION_ARGS)
868868
RelationheapRel;
869869
doublenumSummarized=0;
870870

871+
if (RecoveryInProgress())
872+
ereport(ERROR,
873+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
874+
errmsg("recovery is in progress"),
875+
errhint("BRIN control functions cannot be executed during recovery.")));
876+
871877
if (heapBlk64>BRIN_ALL_BLOCKRANGES||heapBlk64<0)
872878
{
873879
char*blk=psprintf(INT64_FORMAT,heapBlk64);
@@ -939,6 +945,12 @@ brin_desummarize_range(PG_FUNCTION_ARGS)
939945
RelationindexRel;
940946
booldone;
941947

948+
if (RecoveryInProgress())
949+
ereport(ERROR,
950+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
951+
errmsg("recovery is in progress"),
952+
errhint("BRIN control functions cannot be executed during recovery.")));
953+
942954
if (heapBlk64>MaxBlockNumber||heapBlk64<0)
943955
{
944956
char*blk=psprintf(INT64_FORMAT,heapBlk64);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp