Revision 12281
Added by Aaron Marcuse-Kubitza about 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
950 | 950 |
|
951 | 951 |
|
952 | 952 |
-- |
953 |
-- Name: diff_queries(text, text, anyelement); Type: FUNCTION; Schema: util; Owner: - |
|
954 |
-- |
|
955 |
|
|
956 |
CREATE FUNCTION diff_queries(left_query text, right_query text, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement) RETURNS SETOF record |
|
957 |
LANGUAGE sql STABLE |
|
958 |
AS $_$ |
|
959 |
SELECT * FROM util.diff_any('('||$1||')', '('||$2||')', $3) |
|
960 |
$_$; |
|
961 |
|
|
962 |
|
|
963 |
-- |
|
964 |
-- Name: FUNCTION diff_queries(left_query text, right_query text, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement); Type: COMMENT; Schema: util; Owner: - |
|
965 |
-- |
|
966 |
|
|
967 |
COMMENT ON FUNCTION diff_queries(left_query text, right_query text, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement) IS ' |
|
968 |
col_type_null (*required*): NULL::col_type |
|
969 |
usage: |
|
970 |
SELECT * FROM util.diff_queries($$VALUES (''1''), (''2''), (''4'')$$, $$VALUES (''1''), (''3''), (''4'')$$, NULL::text) |
|
971 |
|
|
972 |
to run EXPLAIN on the FULL JOIN query: |
|
973 |
# run this function |
|
974 |
# look for a NOTICE containing the expanded query that it ran |
|
975 |
# run EXPLAIN on this expanded query |
|
976 |
'; |
|
977 |
|
|
978 |
|
|
979 |
-- |
|
980 | 953 |
-- Name: diff_views(regclass, regclass, anyelement); Type: FUNCTION; Schema: util; Owner: - |
981 | 954 |
-- |
982 | 955 |
|
Also available in: Unified diff
schemas/util.sql: removed non-useful diff_queries() (it is not possible to match distinct `record` types to a common return type, so this would not have worked). use diff_views() instead.