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

Commit74da7cd

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 parentdc878ff commit74da7cd

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
@@ -871,6 +871,12 @@ brin_summarize_range(PG_FUNCTION_ARGS)
871871
RelationheapRel;
872872
doublenumSummarized=0;
873873

874+
if (RecoveryInProgress())
875+
ereport(ERROR,
876+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
877+
errmsg("recovery is in progress"),
878+
errhint("BRIN control functions cannot be executed during recovery.")));
879+
874880
if (heapBlk64>BRIN_ALL_BLOCKRANGES||heapBlk64<0)
875881
{
876882
char*blk=psprintf(INT64_FORMAT,heapBlk64);
@@ -942,6 +948,12 @@ brin_desummarize_range(PG_FUNCTION_ARGS)
942948
RelationindexRel;
943949
booldone;
944950

951+
if (RecoveryInProgress())
952+
ereport(ERROR,
953+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
954+
errmsg("recovery is in progress"),
955+
errhint("BRIN control functions cannot be executed during recovery.")));
956+
945957
if (heapBlk64>MaxBlockNumber||heapBlk64<0)
946958
{
947959
char*blk=psprintf(INT64_FORMAT,heapBlk64);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp