Project

General

Profile

« Previous | Next » 

Revision 12298

schemas/util.sql: diff(text, text): added single_row param (not implemented yet, to make reading the svn diff easier). to view this svn diff, it is helpful to use WinMerge, which offers moved block detection (/README.TXT > WinMerge setup).

View differences:

trunk/schemas/util.sql
933 933

  
934 934

  
935 935
--
936
-- Name: diff(text, text, anyelement); Type: FUNCTION; Schema: util; Owner: -
936
-- Name: diff(regclass, regclass, anyelement); Type: FUNCTION; Schema: util; Owner: -
937 937
--
938 938

  
939
CREATE FUNCTION diff(left_ text, right_ text, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement) RETURNS SETOF record
939
CREATE FUNCTION diff(left_table regclass, right_table regclass, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement) RETURNS SETOF record
940 940
    LANGUAGE sql STABLE
941 941
    AS $_$
942
SELECT * FROM util.diff($1::text, $2::text, $3)
943
$_$;
944

  
945

  
946
--
947
-- Name: FUNCTION diff(left_table regclass, right_table regclass, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement); Type: COMMENT; Schema: util; Owner: -
948
--
949

  
950
COMMENT ON FUNCTION diff(left_table regclass, right_table regclass, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement) IS '
951
col_type_null (*required*): NULL::shared_base_type
952
usage:
953
SELECT * FROM util.diff(''"left_table"''::regclass, ''"right_table"''::regclass, NULL::shared_base_type)
954
';
955

  
956

  
957
--
958
-- Name: diff(text, text, anyelement, boolean); Type: FUNCTION; Schema: util; Owner: -
959
--
960

  
961
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
962
    LANGUAGE sql STABLE
963
    AS $_$
942 964
SELECT * FROM
943 965
util.eval2col_pair($$
944 966
/* need to explicitly cast each side to the return type because this does not
......
954 976

  
955 977

  
956 978
--
957
-- Name: FUNCTION diff(left_ text, right_ text, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement); Type: COMMENT; Schema: util; Owner: -
979
-- 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: -
958 980
--
959 981

  
960
COMMENT ON FUNCTION diff(left_ text, right_ text, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement) IS '
982
COMMENT ON FUNCTION diff(left_ text, right_ text, col_type_null anyelement, single_row boolean, OUT left_ anyelement, OUT right_ anyelement) IS '
961 983
col_type_null (*required*): NULL::col_type
962 984

  
963 985
to run EXPLAIN on the FULL JOIN query:
......
968 990

  
969 991

  
970 992
--
971
-- Name: diff(regclass, regclass, anyelement); Type: FUNCTION; Schema: util; Owner: -
972
--
973

  
974
CREATE FUNCTION diff(left_table regclass, right_table regclass, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement) RETURNS SETOF record
975
    LANGUAGE sql STABLE
976
    AS $_$
977
SELECT * FROM util.diff($1::text, $2::text, $3)
978
$_$;
979

  
980

  
981
--
982
-- Name: FUNCTION diff(left_table regclass, right_table regclass, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement); Type: COMMENT; Schema: util; Owner: -
983
--
984

  
985
COMMENT ON FUNCTION diff(left_table regclass, right_table regclass, col_type_null anyelement, OUT left_ anyelement, OUT right_ anyelement) IS '
986
col_type_null (*required*): NULL::shared_base_type
987
usage:
988
SELECT * FROM util.diff(''"left_table"''::regclass, ''"right_table"''::regclass, NULL::shared_base_type)
989
';
990

  
991

  
992
--
993 993
-- Name: do_optionally_ignore(text, boolean); Type: FUNCTION; Schema: util; Owner: -
994 994
--
995 995

  

Also available in: Unified diff