static void AtSubStart_ResourceOwner(void);
static void ShowTransactionState(const char *str);
-static void ShowTransactionStateRec(TransactionState state);
+static void ShowTransactionStateRec(const char *str, TransactionState state);
static const char *BlockStateAsString(TBlockState blockState);
static const char *TransStateAsString(TransState state);
ShowTransactionState(const char *str)
{
/* skip work if message will definitely not be printed */
- if (log_min_messages <= DEBUG3 || client_min_messages <= DEBUG3)
- {
- elog(DEBUG3, "%s", str);
- ShowTransactionStateRec(CurrentTransactionState);
- }
+ if (log_min_messages <= DEBUG5 || client_min_messages <= DEBUG5)
+ ShowTransactionStateRec(str, CurrentTransactionState);
}
/*
* Recursive subroutine for ShowTransactionState
*/
static void
-ShowTransactionStateRec(TransactionState s)
+ShowTransactionStateRec(const char *str, TransactionState s)
{
StringInfoData buf;
{
int i;
- appendStringInfo(&buf, "%u", s->childXids[0]);
+ appendStringInfo(&buf, ", children: %u", s->childXids[0]);
for (i = 1; i < s->nChildXids; i++)
appendStringInfo(&buf, " %u", s->childXids[i]);
}
if (s->parent)
- ShowTransactionStateRec(s->parent);
+ ShowTransactionStateRec(str, s->parent);
/* use ereport to suppress computation if msg will not be printed */
- ereport(DEBUG3,
- (errmsg_internal("name: %s; blockState: %13s; state: %7s, xid/subid/cid: %u/%u/%u%s, nestlvl: %d, children: %s",
+ ereport(DEBUG5,
+ (errmsg_internal("%s(%d) name: %s; blockState: %s; state: %s, xid/subid/cid: %u/%u/%u%s%s",
+ str, s->nestingLevel,
PointerIsValid(s->name) ? s->name : "unnamed",
BlockStateAsString(s->blockState),
TransStateAsString(s->state),
(unsigned int) s->subTransactionId,
(unsigned int) currentCommandId,
currentCommandIdUsed ? " (used)" : "",
- s->nestingLevel, buf.data)));
+ buf.data)));
pfree(buf.data);
}
{
if (!xact_started)
{
- ereport(DEBUG3,
- (errmsg_internal("StartTransactionCommand")));
StartTransactionCommand();
/* Set statement timeout running, if any */
/* Cancel any active statement timeout before committing */
disable_timeout(STATEMENT_TIMEOUT, false);
- /* Now commit the command */
- ereport(DEBUG3,
- (errmsg_internal("CommitTransactionCommand")));
-
CommitTransactionCommand();
#ifdef MEMORY_CONTEXT_CHECKING