Revision 12451
Added by Aaron Marcuse-Kubitza almost 11 years ago
util.sql | ||
---|---|---|
1725 | 1725 |
|
1726 | 1726 |
|
1727 | 1727 |
-- |
1728 |
-- Name: is_explainable(text); Type: FUNCTION; Schema: util; Owner: - |
|
1729 |
-- |
|
1730 |
|
|
1731 |
CREATE FUNCTION is_explainable(sql text) RETURNS boolean |
|
1732 |
LANGUAGE sql IMMUTABLE |
|
1733 |
AS $_$ |
|
1734 |
SELECT upper(util.first_word($1)) = ANY( |
|
1735 |
'{SELECT,INSERT,UPDATE,DELETE,VALUES,EXECUTE,DECLARE}'::text[] |
|
1736 |
/*from http://www.postgresql.org/docs/9.3/static/sql-explain.html#AEN77691*/ |
|
1737 |
) |
|
1738 |
$_$; |
|
1739 |
|
|
1740 |
|
|
1741 |
-- |
|
1728 | 1742 |
-- Name: is_more_complete_than(anyelement, anyelement); Type: FUNCTION; Schema: util; Owner: - |
1729 | 1743 |
-- |
1730 | 1744 |
|
Also available in: Unified diff
schemas/util.sql: added is_explainable(sql)