Revision 10184
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/util.sql | ||
---|---|---|
1331 | 1331 |
|
1332 | 1332 |
|
1333 | 1333 |
-- |
1334 |
-- Name: table_flag__get(regclass, text); Type: FUNCTION; Schema: util; Owner: - |
|
1335 |
-- |
|
1336 |
|
|
1337 |
CREATE FUNCTION table_flag__get(table_ regclass, flag text) RETURNS boolean |
|
1338 |
LANGUAGE sql STABLE STRICT |
|
1339 |
AS $_$ |
|
1340 |
SELECT COUNT(*) > 0 FROM pg_constraint |
|
1341 |
WHERE conrelid = $1 AND contype = 'c' AND conname = $2 |
|
1342 |
$_$; |
|
1343 |
|
|
1344 |
|
|
1345 |
-- |
|
1346 |
-- Name: FUNCTION table_flag__get(table_ regclass, flag text); Type: COMMENT; Schema: util; Owner: - |
|
1347 |
-- |
|
1348 |
|
|
1349 |
COMMENT ON FUNCTION table_flag__get(table_ regclass, flag text) IS 'gets whether a status flag is set by the presence of a table constraint'; |
|
1350 |
|
|
1351 |
|
|
1352 |
-- |
|
1334 | 1353 |
-- Name: table_flag__set(regclass, text); Type: FUNCTION; Schema: util; Owner: - |
1335 | 1354 |
-- |
1336 | 1355 |
|
Also available in: Unified diff
schemas/util.sql: added table_flag__get(), which gets whether a status flag is set by the presence of a table constraint