From 6e43fffe9e2995c0183809550aadef505bf4693c Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Thu, 10 Oct 2024 04:09:53 +0000
Subject: [PATCH v13 1/2] Add XIDOID in [de]construct_array_builtin()

Using construct_array_builtin() for XIDOID is a new use case that is coming with
a new module (not added in the code tree yet).

d746021de1 (which introduced construct_array_builtin()) did not take care of
XIDOID because there were no use case at that time. Now that there is one, let's
add XIDOID.
---
 src/backend/utils/adt/arrayfuncs.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 100.0% src/backend/utils/adt/

diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c
index e5c7e57a5d..8687fae359 100644
--- a/src/backend/utils/adt/arrayfuncs.c
+++ b/src/backend/utils/adt/arrayfuncs.c
@@ -3447,6 +3447,12 @@ construct_array_builtin(Datum *elems, int nelems, Oid elmtype)
 			elmalign = TYPALIGN_SHORT;
 			break;
 
+		case XIDOID:
+			elmlen = sizeof(TransactionId);
+			elmbyval = true;
+			elmalign = TYPALIGN_INT;
+			break;
+
 		default:
 			elog(ERROR, "type %u not supported by construct_array_builtin()", elmtype);
 			/* keep compiler quiet */
@@ -3734,6 +3740,12 @@ deconstruct_array_builtin(ArrayType *array,
 			elmalign = TYPALIGN_SHORT;
 			break;
 
+		case XIDOID:
+			elmlen = sizeof(TransactionId);
+			elmbyval = true;
+			elmalign = TYPALIGN_INT;
+			break;
+
 		default:
 			elog(ERROR, "type %u not supported by deconstruct_array_builtin()", elmtype);
 			/* keep compiler quiet */
-- 
2.34.1

