summaryrefslogtreecommitdiff
path: root/src/include/utils/inet.h
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2011-11-08 22:39:43 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2011-11-08 22:45:28 +0200
commita062ee4257c132b9119151b587b26b3a53558c76 (patch)
tree707ecaaacf9d959805ddf2dc70faac56475d18c8 /src/include/utils/inet.h
parent0ff319d20af757946f57719959172612d0ec75cc (diff)
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.
Diffstat (limited to 'src/include/utils/inet.h')
-rw-r--r--src/include/utils/inet.h4
1 files changed, 3 insertions, 1 deletions
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))