From: Peter Eisentraut Date: Sun, 5 Oct 2008 17:33:17 +0000 (+0000) Subject: Remove obsolete internal functions istrue, isfalse, isnottrue, isnotfalse, X-Git-Tag: recoveryinfrav9~576 X-Git-Url: http://git.postgresql.org/gitweb/irc:/static/gitweb.js?a=commitdiff_plain;h=9cffab6f9a633411852f59de7ba759bd112ec79f;p=users%2Fsimon%2Fpostgres.git Remove obsolete internal functions istrue, isfalse, isnottrue, isnotfalse, nullvalue, nonvalue. A long time ago, these were used to implement the SQL constructs IS TRUE, etc. --- diff --git a/src/backend/utils/adt/bool.c b/src/backend/utils/adt/bool.c index 4c7ea059dd..722f695f76 100644 --- a/src/backend/utils/adt/bool.c +++ b/src/backend/utils/adt/bool.c @@ -221,69 +221,6 @@ boolge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 >= arg2); } -/* - * Per SQL92, istrue() and isfalse() should return false, not NULL, - * when presented a NULL input (since NULL is our implementation of - * UNKNOWN). Conversely isnottrue() and isnotfalse() should return true. - * Therefore, these routines are all declared not-strict in pg_proc - * and must do their own checking for null inputs. - * - * Note we don't need isunknown() and isnotunknown() functions, since - * nullvalue() and nonnullvalue() will serve. - */ - -Datum -istrue(PG_FUNCTION_ARGS) -{ - bool b; - - if (PG_ARGISNULL(0)) - PG_RETURN_BOOL(false); - - b = PG_GETARG_BOOL(0); - - PG_RETURN_BOOL(b); -} - -Datum -isfalse(PG_FUNCTION_ARGS) -{ - bool b; - - if (PG_ARGISNULL(0)) - PG_RETURN_BOOL(false); - - b = PG_GETARG_BOOL(0); - - PG_RETURN_BOOL(!b); -} - -Datum -isnottrue(PG_FUNCTION_ARGS) -{ - bool b; - - if (PG_ARGISNULL(0)) - PG_RETURN_BOOL(true); - - b = PG_GETARG_BOOL(0); - - PG_RETURN_BOOL(!b); -} - -Datum -isnotfalse(PG_FUNCTION_ARGS) -{ - bool b; - - if (PG_ARGISNULL(0)) - PG_RETURN_BOOL(true); - - b = PG_GETARG_BOOL(0); - - PG_RETURN_BOOL(b); -} - /* * boolean-and and boolean-or aggregates. */ diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c index eaad5b58fd..3806dd91ac 100644 --- a/src/backend/utils/adt/misc.c +++ b/src/backend/utils/adt/misc.c @@ -36,28 +36,6 @@ #define atooid(x) ((Oid) strtoul((x), NULL, 10)) -/* - * Check if data is Null - */ -Datum -nullvalue(PG_FUNCTION_ARGS) -{ - if (PG_ARGISNULL(0)) - PG_RETURN_BOOL(true); - PG_RETURN_BOOL(false); -} - -/* - * Check if data is not Null - */ -Datum -nonnullvalue(PG_FUNCTION_ARGS) -{ - if (PG_ARGISNULL(0)) - PG_RETURN_BOOL(false); - PG_RETURN_BOOL(true); -} - /* * current_database() * Expose the current database to the user diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index b453ab08fe..33ded5f19c 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200810041 +#define CATALOG_VERSION_NO 200810051 #endif diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 3aad9372c0..491a9950af 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -1189,11 +1189,6 @@ DESCR("convert text to char"); DATA(insert OID = 946 ( text PGNSP PGUID 12 1 0 0 f f t f i 1 25 "18" _null_ _null_ _null_ char_text _null_ _null_ _null_ )); DESCR("convert char to text"); -DATA(insert OID = 950 ( istrue PGNSP PGUID 12 1 0 0 f f f f i 1 16 "16" _null_ _null_ _null_ istrue _null_ _null_ _null_ )); -DESCR("bool is true (not false or unknown)"); -DATA(insert OID = 951 ( isfalse PGNSP PGUID 12 1 0 0 f f f f i 1 16 "16" _null_ _null_ _null_ isfalse _null_ _null_ _null_ )); -DESCR("bool is false (not true or unknown)"); - DATA(insert OID = 952 ( lo_open PGNSP PGUID 12 1 0 0 f f t f v 2 23 "26 23" _null_ _null_ _null_ lo_open _null_ _null_ _null_ )); DESCR("large object open"); DATA(insert OID = 953 ( lo_close PGNSP PGUID 12 1 0 0 f f t f v 1 23 "23" _null_ _null_ _null_ lo_close _null_ _null_ _null_ )); @@ -1285,10 +1280,6 @@ DESCR("equal"); DATA(insert OID = 1026 ( timezone PGNSP PGUID 12 1 0 0 f f t f i 2 1114 "1186 1184" _null_ _null_ _null_ timestamptz_izone _null_ _null_ _null_ )); DESCR("adjust timestamp to new time zone"); -DATA(insert OID = 1029 ( nullvalue PGNSP PGUID 12 1 0 0 f f f f i 1 16 "2276" _null_ _null_ _null_ nullvalue _null_ _null_ _null_ )); -DESCR("(internal)"); -DATA(insert OID = 1030 ( nonnullvalue PGNSP PGUID 12 1 0 0 f f f f i 1 16 "2276" _null_ _null_ _null_ nonnullvalue _null_ _null_ _null_ )); -DESCR("(internal)"); DATA(insert OID = 1031 ( aclitemin PGNSP PGUID 12 1 0 0 f f t f s 1 1033 "2275" _null_ _null_ _null_ aclitemin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1032 ( aclitemout PGNSP PGUID 12 1 0 0 f f t f s 1 2275 "1033" _null_ _null_ _null_ aclitemout _null_ _null_ _null_ )); @@ -1840,11 +1831,6 @@ DESCR("horizontal?"); DATA(insert OID = 1416 ( point PGNSP PGUID 12 1 0 0 f f t f i 1 600 "718" _null_ _null_ _null_ circle_center _null_ _null_ _null_ )); DESCR("center of"); -DATA(insert OID = 1417 ( isnottrue PGNSP PGUID 12 1 0 0 f f f f i 1 16 "16" _null_ _null_ _null_ isnottrue _null_ _null_ _null_ )); -DESCR("bool is not true (ie, false or unknown)"); -DATA(insert OID = 1418 ( isnotfalse PGNSP PGUID 12 1 0 0 f f f f i 1 16 "16" _null_ _null_ _null_ isnotfalse _null_ _null_ _null_ )); -DESCR("bool is not false (ie, true or unknown)"); - DATA(insert OID = 1419 ( time PGNSP PGUID 12 1 0 0 f f t f i 1 1083 "1186" _null_ _null_ _null_ interval_time _null_ _null_ _null_ )); DESCR("convert interval to time"); diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index d5633eeb69..d205d5ecf9 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -77,10 +77,6 @@ extern Datum boollt(PG_FUNCTION_ARGS); extern Datum boolgt(PG_FUNCTION_ARGS); extern Datum boolle(PG_FUNCTION_ARGS); extern Datum boolge(PG_FUNCTION_ARGS); -extern Datum istrue(PG_FUNCTION_ARGS); -extern Datum isfalse(PG_FUNCTION_ARGS); -extern Datum isnottrue(PG_FUNCTION_ARGS); -extern Datum isnotfalse(PG_FUNCTION_ARGS); extern Datum booland_statefunc(PG_FUNCTION_ARGS); extern Datum boolor_statefunc(PG_FUNCTION_ARGS); @@ -399,8 +395,6 @@ extern Datum pg_read_file(PG_FUNCTION_ARGS); extern Datum pg_ls_dir(PG_FUNCTION_ARGS); /* misc.c */ -extern Datum nullvalue(PG_FUNCTION_ARGS); -extern Datum nonnullvalue(PG_FUNCTION_ARGS); extern Datum current_database(PG_FUNCTION_ARGS); extern Datum current_query(PG_FUNCTION_ARGS); extern Datum pg_cancel_backend(PG_FUNCTION_ARGS);