aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xact.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2013-09-09 16:25:29 -0400
committerRobert Haas <rhaas@postgresql.org>2013-09-09 16:25:29 -0400
commit71901ab6daaad65c0168c05e016e4208efe5b71a (patch)
tree18428bbfda8a7bac64017a9de65c38563aa61ea6 /src/backend/access/transam/xact.c
parent9c68834bfc2ab6e782f56ee3dc7b4949857b8729 (diff)
downloadpostgresql-71901ab6daaad65c0168c05e016e4208efe5b71a.tar.gz
postgresql-71901ab6daaad65c0168c05e016e4208efe5b71a.zip
Introduce InvalidCommandId.
This allows a 32-bit field to represent an *optional* command ID without a separate flag bit. Andres Freund
Diffstat (limited to 'src/backend/access/transam/xact.c')
-rw-r--r--src/backend/access/transam/xact.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 31e868d4bc7..0591f3fd562 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -766,12 +766,12 @@ CommandCounterIncrement(void)
if (currentCommandIdUsed)
{
currentCommandId += 1;
- if (currentCommandId == FirstCommandId) /* check for overflow */
+ if (currentCommandId == InvalidCommandId)
{
currentCommandId -= 1;
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
- errmsg("cannot have more than 2^32-1 commands in a transaction")));
+ errmsg("cannot have more than 2^32-2 commands in a transaction")));
}
currentCommandIdUsed = false;