public inbox for [email protected]help / color / mirror / Atom feed
Re: de-catalog one error message 2+ messages / 2 participants [nested] [flat]
* Re: de-catalog one error message @ 2023-05-16 09:48 Alvaro Herrera <[email protected]> 0 siblings, 0 replies; 2+ messages in thread From: Alvaro Herrera @ 2023-05-16 09:48 UTC (permalink / raw) To: Daniel Gustafsson <[email protected]>; +Cc: Pg Hackers <[email protected]> On 2023-May-11, Daniel Gustafsson wrote: > > On 10 May 2023, at 19:54, Alvaro Herrera <[email protected]> wrote: > > Therefore, I propose to turn these messages into errmsg_internal(), so > > that we do not translate them. > > AFAICT from following the code that seems correct, and I agree with removing > them from translation to lessen the burden on our translators. Thanks for looking! Pushed now. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Pido que me den el Nobel por razones humanitarias" (Nicanor Parra) ^ permalink raw reply [nested|flat] 2+ messages in thread
* [PATCH v52 07/10] Check for transaction block early in ExecRepack @ 2026-04-03 15:23 Srinath Reddy Sadipiralla <[email protected]> 0 siblings, 0 replies; 2+ messages in thread From: Srinath Reddy Sadipiralla @ 2026-04-03 15:23 UTC (permalink / raw) Currently, executing REPACK (CONCURRENTLY) without a table name inside a transaction block throws the error "REPACK CONCURRENTLY requires explicit table name" instead of the expected transaction block error. This occurs because ExecRepack() validates the parsed options and missing relation before verifying the transaction state. This behavior is inconsistent with other utility commands like VACUUM ,REINDEX, etc; which invoke PreventInTransactionBlock() at the very start of their execution to properly reject execution inside user transactions before validating targets. Add PreventInTransactionBlock to the top of ExecRepack() to enforce the transaction block restriction early. This prevents the user from fixing a missing table error only to immediately hit a transaction block error, and also ensures consistency with rest of the commands. Author: Srinath Reddy Sadipiralla <[email protected]> --- src/backend/commands/repack.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c index d6e446d582d..d4c1f0e7652 100644 --- a/src/backend/commands/repack.c +++ b/src/backend/commands/repack.c @@ -292,6 +292,18 @@ ExecRepack(ParseState *pstate, RepackStmt *stmt, bool isTopLevel) MyProc->statusFlags |= PROC_IN_CONCURRENT_REPACK; ProcGlobal->statusFlags[MyProc->pgxactoff] = MyProc->statusFlags; LWLockRelease(ProcArrayLock); + + /* + * Make sure we're not in a transaction block. + * + * The reason is that repack_setup_logical_decoding() could wait + * indefinitely for our XID to complete. (The deadlock detector would + * not recognize it because we'd be waiting for ourselves, i.e. no + * real lock conflict.) It would be possible to run in a transaction + * block if we had no XID, but this restriction is simpler for users + * to understand and we don't lose anything. + */ + PreventInTransactionBlock(isTopLevel, "REPACK (CONCURRENTLY)"); } /* @@ -523,21 +535,7 @@ cluster_rel(RepackCommand cmd, Relation OldHeap, Oid indexOid, * replica index OID. */ if (concurrent) - { - /* - * Make sure we're not in a transaction block. - * - * The reason is that repack_setup_logical_decoding() could wait - * indefinitely for our XID to complete. (The deadlock detector would - * not recognize it because we'd be waiting for ourselves, i.e. no - * real lock conflict.) It would be possible to run in a transaction - * block if we had no XID, but this restriction is simpler for users - * to understand and we don't lose anything. - */ - PreventInTransactionBlock(isTopLevel, "REPACK (CONCURRENTLY)"); - check_repack_concurrently_requirements(OldHeap, &ident_idx); - } /* Check for user-requested abort. */ CHECK_FOR_INTERRUPTS(); -- 2.47.3 --gp2pyozrd5pweboh Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v52-0008-Introduce-an-option-to-make-logical-replication-.patch" ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-04-03 15:23 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-05-16 09:48 Re: de-catalog one error message Alvaro Herrera <[email protected]> 2026-04-03 15:23 [PATCH v52 07/10] Check for transaction block early in ExecRepack Srinath Reddy Sadipiralla <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox