aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/xid.c
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2022-02-10 12:33:41 +0900
committerFujii Masao <fujii@postgresql.org>2022-02-10 12:33:41 +0900
commit400fc6b6487ddf16aa82c9d76e5cfbe64d94f660 (patch)
tree220507135a4655581f534c1948a2ddef702602ff /src/backend/utils/adt/xid.c
parentadbd00f7a59bcfbcd6907858499c94a27c6680ed (diff)
downloadpostgresql-400fc6b6487ddf16aa82c9d76e5cfbe64d94f660.tar.gz
postgresql-400fc6b6487ddf16aa82c9d76e5cfbe64d94f660.zip
Add min() and max() aggregates for xid8.
Bump catalog version. Author: Ken Kato Reviewed-by: Kyotaro Horiguchi, Fujii Masao Discussion: https://postgr.es/m/47d77b18c44f87f8222c4c7a3e2dee6b@oss.nttdata.com
Diffstat (limited to 'src/backend/utils/adt/xid.c')
-rw-r--r--src/backend/utils/adt/xid.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/backend/utils/adt/xid.c b/src/backend/utils/adt/xid.c
index 9b4ceaea47f..e4b4952a281 100644
--- a/src/backend/utils/adt/xid.c
+++ b/src/backend/utils/adt/xid.c
@@ -286,6 +286,30 @@ xid8cmp(PG_FUNCTION_ARGS)
PG_RETURN_INT32(-1);
}
+Datum
+xid8_larger(PG_FUNCTION_ARGS)
+{
+ FullTransactionId fxid1 = PG_GETARG_FULLTRANSACTIONID(0);
+ FullTransactionId fxid2 = PG_GETARG_FULLTRANSACTIONID(1);
+
+ if (FullTransactionIdFollows(fxid1, fxid2))
+ PG_RETURN_FULLTRANSACTIONID(fxid1);
+ else
+ PG_RETURN_FULLTRANSACTIONID(fxid2);
+}
+
+Datum
+xid8_smaller(PG_FUNCTION_ARGS)
+{
+ FullTransactionId fxid1 = PG_GETARG_FULLTRANSACTIONID(0);
+ FullTransactionId fxid2 = PG_GETARG_FULLTRANSACTIONID(1);
+
+ if (FullTransactionIdPrecedes(fxid1, fxid2))
+ PG_RETURN_FULLTRANSACTIONID(fxid1);
+ else
+ PG_RETURN_FULLTRANSACTIONID(fxid2);
+}
+
/*****************************************************************************
* COMMAND IDENTIFIER ROUTINES *
*****************************************************************************/