Revision 12296
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
1444 | 1444 |
|
1445 | 1445 |
|
1446 | 1446 |
-- |
1447 |
-- Name: has_single_row(regclass); Type: FUNCTION; Schema: util; Owner: - |
|
1448 |
-- |
|
1449 |
|
|
1450 |
CREATE FUNCTION has_single_row(table_ regclass) RETURNS boolean |
|
1451 |
LANGUAGE sql STABLE |
|
1452 |
AS $_$ |
|
1453 |
SELECT util.eval2val($$SELECT COUNT(*) = 1 FROM $$||$1, NULL::boolean) |
|
1454 |
$_$; |
|
1455 |
|
|
1456 |
|
|
1457 |
-- |
|
1447 | 1458 |
-- Name: hstore(text[], text); Type: FUNCTION; Schema: util; Owner: - |
1448 | 1459 |
-- |
1449 | 1460 |
|
Also available in: Unified diff
schemas/util.sql: added has_single_row()