Revision 10329
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/util.sql | ||
---|---|---|
1290 | 1290 |
CREATE FUNCTION not_empty(value anyarray) RETURNS boolean |
1291 | 1291 |
LANGUAGE sql IMMUTABLE |
1292 | 1292 |
AS $_$ |
1293 |
SELECT $1 IS NOT NULL AND array_length($1, 1)/*ARRAY[]->NULL*/ IS NOT NULL
|
|
1293 |
SELECT $1 IS NOT NULL AND util.array_length($1) > 0
|
|
1294 | 1294 |
$_$; |
1295 | 1295 |
|
1296 | 1296 |
|
Also available in: Unified diff
bugfix: schemas/util.sql: not_empty(anyarray): array_length() now refers to different functions, with different semantics, depending on whether util is in the search_path. this necessitates explicitly selecting util.array_length() and switching to its semantics (ARRAY[] -> 0 instead of NULL)