Index: src/include/catalog/pg_proc.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/catalog/pg_proc.h,v retrieving revision 1.348 diff -u -r1.348 pg_proc.h --- src/include/catalog/pg_proc.h 7 Oct 2004 18:38:50 -0000 1.348 +++ src/include/catalog/pg_proc.h 10 Oct 2004 06:24:40 -0000 @@ -3604,6 +3604,9 @@ DATA(insert OID = 2556 ( pg_tablespace_databases PGNSP PGUID 12 f f t t s 1 26 "26" _null_ pg_tablespace_databases - _null_)); DESCR("returns database oids in a tablespace"); +DATA(insert OID = 2557 ( bool PGNSP PGUID 12 f f t f i 1 16 "23" _null_ int4_bool - _null_ )); +DESCR("convert int4 to boolean"); + /* * Symbolic values for provolatile column: these indicate whether the result Index: src/include/catalog/pg_cast.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/catalog/pg_cast.h,v retrieving revision 1.16 diff -u -r1.16 pg_cast.h --- src/include/catalog/pg_cast.h 4 Oct 2004 22:49:54 -0000 1.16 +++ src/include/catalog/pg_cast.h 10 Oct 2004 06:24:40 -0000 @@ -80,6 +80,7 @@ DATA(insert ( 21 700 236 i )); DATA(insert ( 21 701 235 i )); DATA(insert ( 21 1700 1782 i )); +DATA(insert ( 23 16 2557 a )); DATA(insert ( 23 20 481 i )); DATA(insert ( 23 21 314 a )); DATA(insert ( 23 700 318 i )); Index: src/backend/utils/adt/int.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/adt/int.c,v retrieving revision 1.63 diff -u -r1.63 int.c --- src/backend/utils/adt/int.c 4 Oct 2004 14:42:46 -0000 1.63 +++ src/backend/utils/adt/int.c 10 Oct 2004 06:24:41 -0000 @@ -361,6 +361,17 @@ return result; } +Datum +int4_bool(PG_FUNCTION_ARGS) +{ + int32 arg1 = PG_GETARG_INT32(0); + + if (arg1) + PG_RETURN_BOOL(true); + else + PG_RETURN_BOOL(false); +} + /* * ============================ Index: src/include/utils/builtins.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/utils/builtins.h,v retrieving revision 1.251 diff -u -r1.251 builtins.h --- src/include/utils/builtins.h 4 Oct 2004 22:49:59 -0000 1.251 +++ src/include/utils/builtins.h 10 Oct 2004 06:24:42 -0000 @@ -111,6 +111,7 @@ extern Datum i4toi2(PG_FUNCTION_ARGS); extern Datum int2_text(PG_FUNCTION_ARGS); extern Datum text_int2(PG_FUNCTION_ARGS); +extern Datum int4_bool(PG_FUNCTION_ARGS); extern Datum int4_text(PG_FUNCTION_ARGS); extern Datum text_int4(PG_FUNCTION_ARGS); extern Datum int4eq(PG_FUNCTION_ARGS);