Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e951f66

Browse files
committed
Fail BRIN control functions during recovery explicitly
They already fail anyway, but prior to this patch they raise an ugly error message about a lock that cannot be acquired. This just improves the message. Author: Masahiko Sawada Reported-by: Masahiko Sawada Discussion: https://postgr.es/m/CAD21AoBZau4g4_NUf3BKNd=CdYK+xaPdtJCzvOC1TxGdTiJx_Q@mail.gmail.com Reviewed-by: Kuntal Ghosh, Alexander Korotkov, Simon Riggs, Michaël Paquier, Álvaro Herrera
1 parent c7699d9 commit e951f66

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/access/brin/brin.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,12 @@ brin_summarize_new_values(PG_FUNCTION_ARGS)
788788
Relation heapRel;
789789
double numSummarized = 0;
790790

791+
if (RecoveryInProgress())
792+
ereport(ERROR,
793+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
794+
errmsg("recovery is in progress"),
795+
errhint("BRIN control functions cannot be executed during recovery.")));
796+
791797
/*
792798
* We must lock table before index to avoid deadlocks. However, if the
793799
* passed indexoid isn't an index then IndexGetRelation() will fail.

0 commit comments

Comments
 (0)