Revision 12486
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
2092 | 2092 |
CREATE FUNCTION mk_search_path(VARIADIC schemas text[]) RETURNS text |
2093 | 2093 |
LANGUAGE sql IMMUTABLE |
2094 | 2094 |
AS $_$ |
2095 |
SELECT string_agg(quote_ident(unnest), ', ') FROM unnest($1) |
|
2095 |
SELECT string_agg(quote_ident(unnest), ', ') FROM unnest($1||'util'::text)
|
|
2096 | 2096 |
$_$; |
2097 | 2097 |
|
2098 | 2098 |
|
2099 | 2099 |
-- |
2100 |
-- Name: FUNCTION mk_search_path(VARIADIC schemas text[]); Type: COMMENT; Schema: util; Owner: - |
|
2101 |
-- |
|
2102 |
|
|
2103 |
COMMENT ON FUNCTION mk_search_path(VARIADIC schemas text[]) IS ' |
|
2104 |
auto-appends util to the search_path to enable use of util operators |
|
2105 |
'; |
|
2106 |
|
|
2107 |
|
|
2108 |
-- |
|
2100 | 2109 |
-- Name: mk_set_search_path(text[]); Type: FUNCTION; Schema: util; Owner: - |
2101 | 2110 |
-- |
2102 | 2111 |
|
... | ... | |
2116 | 2125 |
for *1* schema arg: |
2117 | 2126 |
SELECT util.mk_set_search_path(''schema'', NULL) AS search_path; |
2118 | 2127 |
-- 2 params are needed to use the correct variant of mk_set_search_path() |
2128 |
|
|
2129 |
auto-appends util to the search_path to enable use of util operators |
|
2119 | 2130 |
'; |
2120 | 2131 |
|
2121 | 2132 |
|
Also available in: Unified diff
schemas/util.sql: mk_search_path(), mk_set_search_path(text...): auto-append util to the search_path to enable use of util operators