Remove obsolete internal functions istrue, isfalse, isnottrue, isnotfalse,
authorPeter Eisentraut <[email protected]>
Sun, 5 Oct 2008 17:33:17 +0000 (17:33 +0000)
committerPeter Eisentraut <[email protected]>
Sun, 5 Oct 2008 17:33:17 +0000 (17:33 +0000)
nullvalue, nonvalue.  A long time ago, these were used to implement the SQL
constructs IS TRUE, etc.

src/backend/utils/adt/bool.c
src/backend/utils/adt/misc.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.h
src/include/utils/builtins.h

index 4c7ea059dd230d75495a4d232da762a0e842f84c..722f695f760cfe99089855e30a184a7f5d781184 100644 (file)
@@ -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.
  */
index eaad5b58fd05a20d44ce7eb79325c9a2711cedb5..3806dd91ac528c9a0fdc68e163f337f979f9e9b3 100644 (file)
 #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
index b453ab08fe1d9347d52fa689a7fcfa173f22b474..33ded5f19cbd2e14fb6f0f9e53ef3beadc9fb8d2 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     200810041
+#define CATALOG_VERSION_NO     200810051
 
 #endif
index 3aad9372c064f676aa76fc662ddfc3ff1cb1c06b..491a9950aff2f644d26e5199956cd2662d0d005c 100644 (file)
@@ -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");
 
index d5633eeb69753893968390fdf70855024c7c0080..d205d5ecf9f6d0eb6b31f013cbd95f9f014d2769 100644 (file)
@@ -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);