Revision 12491
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
1026 | 1026 |
LANGUAGE sql |
1027 | 1027 |
AS $_$ |
1028 | 1028 |
SELECT * FROM util.diff($1::text, $2::text, $3, |
1029 |
single_row := util.has_single_row($1) AND util.has_single_row($2), |
|
1030 |
search_path := util.schema($3)) |
|
1029 |
single_row := util.has_single_row($1) AND util.has_single_row($2)) |
|
1031 | 1030 |
$_$; |
1032 | 1031 |
|
1033 | 1032 |
|
... | ... | |
1043 | 1042 |
|
1044 | 1043 |
|
1045 | 1044 |
-- |
1046 |
-- Name: diff(text, text, anyelement, boolean, text); Type: FUNCTION; Schema: util; Owner: -
|
|
1045 |
-- Name: diff(text, text, anyelement, boolean); Type: FUNCTION; Schema: util; Owner: - |
|
1047 | 1046 |
-- |
1048 | 1047 |
|
1049 |
CREATE FUNCTION diff(left__ text, right__ text, col_type_null anyelement, single_row boolean DEFAULT false, search_path text DEFAULT NULL::text, OUT left_ anyelement, OUT right_ anyelement) RETURNS SETOF record
|
|
1048 |
CREATE FUNCTION diff(left__ text, right__ text, col_type_null anyelement, single_row boolean DEFAULT false, OUT left_ anyelement, OUT right_ anyelement) RETURNS SETOF record |
|
1050 | 1049 |
LANGUAGE plpgsql |
1051 | 1050 |
SET search_path TO pg_temp |
1052 | 1051 |
AS $_$ |
... | ... | |
1056 | 1055 |
/* function option search_path is needed to limit the effects of |
1057 | 1056 |
`SET LOCAL search_path` (mk_set_search_path()) to the current function */ |
1058 | 1057 |
BEGIN |
1059 |
PERFORM util.set_search_path(concat_ws(', ', search_path, 'util')); |
|
1060 |
-- need util.%== as default/fallback |
|
1058 |
PERFORM util.use_schema($3); -- includes util.%== as default/fallback |
|
1061 | 1059 |
|
1062 | 1060 |
RETURN QUERY |
1063 | 1061 |
SELECT * FROM util.eval2col_pair(util.mk_diff_query($1, $2, $4, |
... | ... | |
1072 | 1070 |
|
1073 | 1071 |
|
1074 | 1072 |
-- |
1075 |
-- Name: FUNCTION diff(left__ text, right__ text, col_type_null anyelement, single_row boolean, search_path text, OUT left_ anyelement, OUT right_ anyelement); Type: COMMENT; Schema: util; Owner: -
|
|
1073 |
-- Name: FUNCTION diff(left__ text, right__ text, col_type_null anyelement, single_row boolean, OUT left_ anyelement, OUT right_ anyelement); Type: COMMENT; Schema: util; Owner: - |
|
1076 | 1074 |
-- |
1077 | 1075 |
|
1078 |
COMMENT ON FUNCTION diff(left__ text, right__ text, col_type_null anyelement, single_row boolean, search_path text, OUT left_ anyelement, OUT right_ anyelement) IS '
|
|
1076 |
COMMENT ON FUNCTION diff(left__ text, right__ text, col_type_null anyelement, single_row boolean, OUT left_ anyelement, OUT right_ anyelement) IS ' |
|
1079 | 1077 |
col_type_null (*required*): NULL::col_type |
1080 | 1078 |
single_row: whether the tables consist of a single row, which should be |
1081 | 1079 |
displayed side-by-side |
Also available in: Unified diff
schemas/util.sql: diff(text, text): always use the schema of col_type_null (the common base type) as the search_path, since any custom %== operator for it will always be in the same schema as it