Revision 14200
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/schemas/util.sql | ||
---|---|---|
5136 | 5136 |
|
5137 | 5137 |
|
5138 | 5138 |
-- |
5139 |
-- Name: table_has_data(regclass); Type: FUNCTION; Schema: util; Owner: - |
|
5140 |
-- |
|
5141 |
|
|
5142 |
CREATE FUNCTION table_has_data(table_ regclass) RETURNS boolean |
|
5143 |
LANGUAGE sql STABLE |
|
5144 |
AS $_$ |
|
5145 |
SELECT util.eval2val($$SELECT EXISTS(SELECT NULL FROM $$||table_||$$ LIMIT 1)$$, |
|
5146 |
NULL::boolean) |
|
5147 |
$_$; |
|
5148 |
|
|
5149 |
|
|
5150 |
-- |
|
5139 | 5151 |
-- Name: table_nulls_mapped__get(regclass); Type: FUNCTION; Schema: util; Owner: - |
5140 | 5152 |
-- |
5141 | 5153 |
|
Also available in: Unified diff
schemas/util.sql: added table_has_data()