Revision 12299
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
966 | 966 |
/* need to explicitly cast each side to the return type because this does not |
967 | 967 |
happen automatically even when an implicit cast is available */ |
968 | 968 |
SELECT left_::$$||pg_typeof($3)||$$, right_::$$||pg_typeof($3)||$$ |
969 |
FROM $$||$1||$$ left_ |
|
970 |
FULL JOIN $$||$2||$$ right_ |
|
971 |
ON left_ = right_ |
|
969 |
FROM $$||$1||$$ left_ |
|
970 |
$$||util._if($4, 'CROSS'::text, 'FULL')||$$ JOIN $$||$2||$$ right_ |
|
971 |
$$||util._if($4, ''::text, |
|
972 |
$$ON left_ = right_ |
|
972 | 973 |
WHERE left_ IS DISTINCT FROM right_ |
973 | 974 |
ORDER BY left_, right_ |
974 |
$$, $3) |
|
975 |
$$), $3)
|
|
975 | 976 |
$_$; |
976 | 977 |
|
977 | 978 |
|
... | ... | |
981 | 982 |
|
982 | 983 |
COMMENT ON FUNCTION diff(left_ text, right_ text, col_type_null anyelement, single_row boolean, OUT left_ anyelement, OUT right_ anyelement) IS ' |
983 | 984 |
col_type_null (*required*): NULL::col_type |
985 |
single_row: whether the tables consist of a single row, which should be |
|
986 |
displayed side-by-side |
|
984 | 987 |
|
985 | 988 |
to run EXPLAIN on the FULL JOIN query: |
986 | 989 |
# run this function |
Also available in: Unified diff
schemas/util.sql: diff(text, text): implemented the single_row feature