summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/bool.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt/bool.c')
-rw-r--r--src/backend/utils/adt/bool.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/backend/utils/adt/bool.c b/src/backend/utils/adt/bool.c
index ddb8c923591..4b19cfdee03 100644
--- a/src/backend/utils/adt/bool.c
+++ b/src/backend/utils/adt/bool.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/bool.c,v 1.32 2004/05/07 00:24:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/bool.c,v 1.33 2004/05/26 15:25:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -248,3 +248,23 @@ isnotfalse(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(b);
}
+
+/*
+ * boolean-and and boolean-or aggregates.
+ */
+
+/* function for standard EVERY aggregate implementation conforming to SQL 2003.
+ * must be strict. It is also named bool_and for homogeneity.
+ */
+Datum booland_statefunc(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(PG_GETARG_BOOL(0) && PG_GETARG_BOOL(1));
+}
+
+/* function for standard ANY/SOME aggregate conforming to SQL 2003.
+ * must be strict. The name of the aggregate is bool_or. See the doc.
+ */
+Datum boolor_statefunc(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_BOOL(PG_GETARG_BOOL(0) || PG_GETARG_BOOL(1));
+}