Revision 8200
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/util.sql | ||
---|---|---|
647 | 647 |
|
648 | 648 |
|
649 | 649 |
-- |
650 |
-- Name: do_optionally_ignore(text, boolean); Type: FUNCTION; Schema: util; Owner: - |
|
651 |
-- |
|
652 |
|
|
653 |
CREATE FUNCTION do_optionally_ignore(sql text, ignore boolean) RETURNS void |
|
654 |
LANGUAGE sql STRICT |
|
655 |
AS $_$ |
|
656 |
SELECT CASE WHEN $2 THEN util.try_create($1) ELSE util.create_if_not_exists($1) END |
|
657 |
$_$; |
|
658 |
|
|
659 |
|
|
660 |
-- |
|
661 |
-- Name: FUNCTION do_optionally_ignore(sql text, ignore boolean); Type: COMMENT; Schema: util; Owner: - |
|
662 |
-- |
|
663 |
|
|
664 |
COMMENT ON FUNCTION do_optionally_ignore(sql text, ignore boolean) IS 'idempotent'; |
|
665 |
|
|
666 |
|
|
667 |
-- |
|
650 | 668 |
-- Name: ensure_prefix(text, text); Type: FUNCTION; Schema: util; Owner: - |
651 | 669 |
-- |
652 | 670 |
|
Also available in: Unified diff
schemas/util.sql: Added do_optionally_ignore()