diff options
| author | Heikki Linnakangas | 2011-11-08 20:39:43 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2011-11-08 20:39:43 +0000 |
| commit | 3b8161723c645853021b57330dd2ea0484ec6131 (patch) | |
| tree | 35598ad6595115ba8b60466fe877628156f60562 /src/include | |
| parent | 0e1c4b7d974b9ff3b1cd62a9689a8560a8bab60e (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')
| -rw-r--r-- | src/include/utils/inet.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/utils/inet.h b/src/include/utils/inet.h index 9626a2de81f..fa217b66116 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)) |
