From a062ee4257c132b9119151b587b26b3a53558c76 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Tue, 8 Nov 2011 22:39:43 +0200 Subject: Make DatumGetInetP() unpack inet datums with a 1-byte header, and add a new macro, DatumGetInetPP(), that does not. This brings these macros in line with other DatumGet*P() macros. Backpatch to 8.3, where 1-byte header varlenas were introduced. --- src/include/utils/inet.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/include/utils/inet.h') diff --git a/src/include/utils/inet.h b/src/include/utils/inet.h index 948f0cde9d9..2a526a3c807 100644 --- a/src/include/utils/inet.h +++ b/src/include/utils/inet.h @@ -70,9 +70,11 @@ typedef struct macaddr /* * fmgr interface macros */ -#define DatumGetInetP(X) ((inet *) PG_DETOAST_DATUM_PACKED(X)) +#define DatumGetInetP(X) ((inet *) PG_DETOAST_DATUM(X)) +#define DatumGetInetPP(X) ((inet *) PG_DETOAST_DATUM_PACKED(X)) #define InetPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_INET_P(n) DatumGetInetP(PG_GETARG_DATUM(n)) +#define PG_GETARG_INET_PP(n) DatumGetInetP(PG_GETARG_DATUM_PACKED(n)) #define PG_RETURN_INET_P(x) return InetPGetDatum(x) /* macaddr is a fixed-length pass-by-reference datatype */ #define DatumGetMacaddrP(X) ((macaddr *) DatumGetPointer(X)) -- cgit v1.2.3