Skip to content

Commit 661f821

Browse files
committed
Use ereport() rather than elog()
Noah pointed this out before I committed 50f770c, but I accidentally pushed the old version with elog() anyway. Oops. Reported-by: Noah Misch <noah@leadboat.com> Discussion: https://www.postgresql.org/message-id/20250820003756.31.nmisch@google.com
1 parent 50f770c commit 661f821

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/backend/access/heap/heapam.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,8 +1148,10 @@ heap_beginscan(Relation relation, Snapshot snapshot,
11481148
IsHistoricMVCCSnapshot(snapshot) &&
11491149
!RelationIsAccessibleInLogicalDecoding(relation))
11501150
{
1151-
elog(ERROR, "cannot query non-catalog table \"%s\" during logical decoding",
1152-
RelationGetRelationName(relation));
1151+
ereport(ERROR,
1152+
(errcode(ERRCODE_INVALID_TRANSACTION_STATE),
1153+
errmsg("cannot query non-catalog table \"%s\" during logical decoding",
1154+
RelationGetRelationName(relation))));
11531155
}
11541156

11551157
/*

src/backend/access/index/indexam.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,10 @@ index_beginscan(Relation heapRelation,
267267
if (IsHistoricMVCCSnapshot(snapshot) &&
268268
!RelationIsAccessibleInLogicalDecoding(heapRelation))
269269
{
270-
elog(ERROR, "cannot query non-catalog table \"%s\" during logical decoding",
271-
RelationGetRelationName(heapRelation));
270+
ereport(ERROR,
271+
(errcode(ERRCODE_INVALID_TRANSACTION_STATE),
272+
errmsg("cannot query non-catalog table \"%s\" during logical decoding",
273+
RelationGetRelationName(heapRelation))));
272274
}
273275

274276
scan = index_beginscan_internal(indexRelation, nkeys, norderbys, snapshot, NULL, false);

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