Revision 12590
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
959 | 959 |
-- |
960 | 960 |
|
961 | 961 |
CREATE FUNCTION curr_func(func text, schema_anchor anyelement) RETURNS text |
962 |
LANGUAGE sql IMMUTABLE
|
|
962 |
LANGUAGE sql STABLE
|
|
963 | 963 |
AS $$ |
964 | 964 |
SELECT util.schema_esc(schema_anchor)||'.'||quote_ident(func) |
965 | 965 |
$$; |
... | ... | |
2072 | 2072 |
-- |
2073 | 2073 |
|
2074 | 2074 |
CREATE FUNCTION mk_keys_func(type regtype) RETURNS void |
2075 |
LANGUAGE sql IMMUTABLE
|
|
2075 |
LANGUAGE sql VOLATILE
|
|
2076 | 2076 |
AS $_$ |
2077 | 2077 |
-- keys() |
2078 | 2078 |
SELECT util.mk_keys_func($1, ARRAY( |
... | ... | |
2096 | 2096 |
-- |
2097 | 2097 |
|
2098 | 2098 |
CREATE FUNCTION mk_keys_func(type regtype, cols col_cast[], name text DEFAULT 'keys'::text) RETURNS void |
2099 |
LANGUAGE sql IMMUTABLE
|
|
2099 |
LANGUAGE sql VOLATILE
|
|
2100 | 2100 |
AS $_$ |
2101 | 2101 |
SELECT util.create_if_not_exists($$ |
2102 | 2102 |
CREATE TYPE $$||util.prefixed_name($3||'_', $1)||$$ AS |
... | ... | |
3623 | 3623 |
-- |
3624 | 3624 |
|
3625 | 3625 |
CREATE FUNCTION typed_cols(type regtype) RETURNS SETOF col_cast |
3626 |
LANGUAGE sql IMMUTABLE
|
|
3626 |
LANGUAGE sql STABLE
|
|
3627 | 3627 |
AS $_$ |
3628 | 3628 |
SELECT (attname::text, atttypid)::util.col_cast |
3629 | 3629 |
FROM pg_attribute |
Also available in: Unified diff
bugfix: schemas/util.sql: functions marked IMMUTABLE: changed to STABLE or VOLATILE where IMMUTABLE would cause preemptive inlining (http://vegpath.org/links/#PostgreSQL:%20Documentation:%209.3:%20Function%20Volatility%20Categories%20**)