diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-26 02:35:51 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-26 02:35:51 +0000 |
commit | 8d8bf127605d0a87b22bb07e630a075506ca5e1e (patch) | |
tree | 3ad06ce423081f23df826753da0dc7f998e58822 /src/include/utils/builtins.h | |
parent | 5997386a0a38f3ded28ce6eb2c2b4f110b377e46 (diff) | |
download | postgresql-8d8bf127605d0a87b22bb07e630a075506ca5e1e.tar.gz |
Clean up the INET-vs-CIDR situation. Get rid of the internal is_cidr flag
and rely exclusively on the SQL type system to tell the difference between
the types. Prevent creation of invalid CIDR values via casting from INET
or set_masklen() --- both of these operations now silently zero any bits
to the right of the netmask. Remove duplicate CIDR comparison operators,
letting the type rely on the INET operators instead.
Diffstat (limited to 'src/include/utils/builtins.h')
-rw-r--r-- | src/include/utils/builtins.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index e8ad4bd0e2..527d5ce8e8 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.271 2006/01/18 06:49:29 neilc Exp $ + * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.272 2006/01/26 02:35:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -720,11 +720,14 @@ extern Datum network_family(PG_FUNCTION_ARGS); extern Datum network_broadcast(PG_FUNCTION_ARGS); extern Datum network_host(PG_FUNCTION_ARGS); extern Datum network_show(PG_FUNCTION_ARGS); -extern Datum network_abbrev(PG_FUNCTION_ARGS); +extern Datum inet_abbrev(PG_FUNCTION_ARGS); +extern Datum cidr_abbrev(PG_FUNCTION_ARGS); extern double convert_network_to_scalar(Datum value, Oid typid); extern Datum text_cidr(PG_FUNCTION_ARGS); extern Datum text_inet(PG_FUNCTION_ARGS); +extern Datum inet_to_cidr(PG_FUNCTION_ARGS); extern Datum inet_set_masklen(PG_FUNCTION_ARGS); +extern Datum cidr_set_masklen(PG_FUNCTION_ARGS); extern Datum network_scan_first(Datum in); extern Datum network_scan_last(Datum in); extern Datum inet_client_addr(PG_FUNCTION_ARGS); |