aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/xid.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt/xid.c')
-rw-r--r--src/backend/utils/adt/xid.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/utils/adt/xid.c b/src/backend/utils/adt/xid.c
index e4b4952a281..ade60281594 100644
--- a/src/backend/utils/adt/xid.c
+++ b/src/backend/utils/adt/xid.c
@@ -31,8 +31,10 @@ Datum
xidin(PG_FUNCTION_ARGS)
{
char *str = PG_GETARG_CSTRING(0);
+ TransactionId result;
- PG_RETURN_TRANSACTIONID((TransactionId) strtoul(str, NULL, 0));
+ result = uint32in_subr(str, NULL, "xid", fcinfo->context);
+ PG_RETURN_TRANSACTIONID(result);
}
Datum
@@ -183,8 +185,10 @@ Datum
xid8in(PG_FUNCTION_ARGS)
{
char *str = PG_GETARG_CSTRING(0);
+ uint64 result;
- PG_RETURN_FULLTRANSACTIONID(FullTransactionIdFromU64(strtou64(str, NULL, 0)));
+ result = uint64in_subr(str, NULL, "xid8", fcinfo->context);
+ PG_RETURN_FULLTRANSACTIONID(FullTransactionIdFromU64(result));
}
Datum
@@ -321,8 +325,10 @@ Datum
cidin(PG_FUNCTION_ARGS)
{
char *str = PG_GETARG_CSTRING(0);
+ CommandId result;
- PG_RETURN_COMMANDID((CommandId) strtoul(str, NULL, 0));
+ result = uint32in_subr(str, NULL, "cid", fcinfo->context);
+ PG_RETURN_COMMANDID(result);
}
/*