Revision 13839
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/schemas/util.sql | ||
---|---|---|
4614 | 4614 |
|
4615 | 4615 |
|
4616 | 4616 |
-- |
4617 |
-- Name: view_is_automatically_updatable(text); Type: FUNCTION; Schema: util; Owner: - |
|
4618 |
-- |
|
4619 |
|
|
4620 |
CREATE FUNCTION view_is_automatically_updatable(view_def text) RETURNS boolean |
|
4621 |
LANGUAGE sql IMMUTABLE |
|
4622 |
AS $_$ |
|
4623 |
SELECT $1 !~ '\y(?:JOIN|WITH|DISTINCT|GROUP BY|HAVING|LIMIT|OFFSET)\y' |
|
4624 |
/* from http://www.postgresql.org/docs/9.3/static/sql-createview.html#SQL-CREATEVIEW-UPDATABLE-VIEWS */ |
|
4625 |
$_$; |
|
4626 |
|
|
4627 |
|
|
4628 |
-- |
|
4617 | 4629 |
-- Name: all_same(anyelement); Type: AGGREGATE; Schema: util; Owner: - |
4618 | 4630 |
-- |
4619 | 4631 |
|
Also available in: Unified diff
schemas/util.sql: added view_is_automatically_updatable(view_def text)