Contents
bool_and()
A function returning true or false depending on whether all non-NULL input values are true
bool_and()
is a system function which returns true if all non-NULL
input values are true
, otherwise false
.
bool_and()
was added in PostgreSQL 8.0.
Usage
bool_and ( boolean ) → boolean
bool_and()
is equivalen to the SQL standard every()
.
Change history
- PostgreSQL 8.0
- added (commit 8096fe45)
Examples
postgres=# CREATE TABLE booltest (val bool); CREATE TABLE postgres=# INSERT INTO booltest VALUES (TRUE); INSERT 0 1 postgres=# SELECT bool_and(val) FROM booltest; bool_and ---------- t (1 row) postgres=# INSERT INTO booltest values (FALSE); INSERT 0 1 postgres=# SELECT bool_and(val) FROM booltest; bool_and ---------- f (1 row)
References
- PostgreSQL documentation: General-Purpose Aggregate Functions,