From 5cabcfccce4b8b826c9b30828f3012b7926a6946 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 26 Aug 2002 17:54:02 +0000 Subject: Modify array operations to include array's element type OID in the array header, and to compute sizing and alignment of array elements the same way normal tuple access operations do --- viz, using the tupmacs.h macros att_addlength and att_align. This makes the world safe for arrays of cstrings or intervals, and should make it much easier to write array-type-polymorphic functions; as examples see the cleanups of array_out and contrib/array_iterator. By Joe Conway and Tom Lane. --- src/backend/utils/adt/varchar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/adt/varchar.c') diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c index 2520d415d5..cdf5c301d2 100644 --- a/src/backend/utils/adt/varchar.c +++ b/src/backend/utils/adt/varchar.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.90 2002/06/20 20:29:38 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.91 2002/08/26 17:53:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -283,7 +283,7 @@ bpchar(PG_FUNCTION_ARGS) Datum _bpchar(PG_FUNCTION_ARGS) { - ArrayType *v = (ArrayType *) PG_GETARG_VARLENA_P(0); + ArrayType *v = PG_GETARG_ARRAYTYPE_P(0); int32 len = PG_GETARG_INT32(1); FunctionCallInfoData locfcinfo; @@ -533,7 +533,7 @@ varchar(PG_FUNCTION_ARGS) Datum _varchar(PG_FUNCTION_ARGS) { - ArrayType *v = (ArrayType *) PG_GETARG_VARLENA_P(0); + ArrayType *v = PG_GETARG_ARRAYTYPE_P(0); int32 len = PG_GETARG_INT32(1); FunctionCallInfoData locfcinfo; -- cgit v1.2.1