diff --git a/contrib/try_convert/check_test.py b/contrib/try_convert/check_test.py index 39a2d3608f..2055e4ff67 100644 --- a/contrib/try_convert/check_test.py +++ b/contrib/try_convert/check_test.py @@ -23,11 +23,13 @@ 'interval' 'regproc', + 'pg_catalog', + 'regclass', + 'regtype', + 'value_day', 'oid', 'jsonb', - 'pg_catalog' - 'reg_class' # 'text', # 'bpchar', @@ -35,10 +37,13 @@ # 'char' ] +failed_tests = {} + for i in range(1, len(lines)): + preline = lines[i-1] line = lines[i] - if len(line) > 0 and len(lines[i-1]) > 0 and line[0] == '-' and lines[i-1][0] != '-': - words = re.split('::|\*|;|\n| |\(|\)|,|\.|\".*\"|\'.*\'|<.*>', lines[i-1]) + if len(line) > 0 and len(preline) > 0 and (line[0] == '-' or line[0] == '+') and (preline[0] != '-' and preline[0] != '+'): + words = re.split('::|\*|;|\n| |\(|\)|,|\.|\".*\"|\'.*\'|<.*>', preline) ans = [] is_prining = False for word in words: @@ -50,5 +55,8 @@ if w in needed_types: is_prining = True if is_prining: - print(' '.join(ans)) + failed_tests[' '.join(ans)] = True + +for ft in failed_tests: + print(ft) \ No newline at end of file diff --git a/contrib/try_convert/data/tt_oid.data b/contrib/try_convert/data/tt_oid.data new file mode 100644 index 0000000000..1d1d304886 --- /dev/null +++ b/contrib/try_convert/data/tt_oid.data @@ -0,0 +1,13 @@ +232 +2908 +1069 +20 +21 +24 +2950 +701 +18 +19 +114 +1247 +1259 \ No newline at end of file diff --git a/contrib/try_convert/data/tt_regclass.data b/contrib/try_convert/data/tt_regclass.data new file mode 100644 index 0000000000..df7234772a --- /dev/null +++ b/contrib/try_convert/data/tt_regclass.data @@ -0,0 +1,12 @@ +pg_type +pg_proc +pg_class +pg_attribute +pg_user +pg_statistic +pg_class_oid_index +pg_views +pg_timezone_names +pg_stat_database +pg_tables +pg_roles \ No newline at end of file diff --git a/contrib/try_convert/data/tt_regproc.data b/contrib/try_convert/data/tt_regproc.data new file mode 100644 index 0000000000..c1fdfdc54f --- /dev/null +++ b/contrib/try_convert/data/tt_regproc.data @@ -0,0 +1,11 @@ +textin +int4lt +float8abs +232 +2908 +now +pg_stat_get_activity +pg_table_size +1069 +inet_client_addr +inet_server_addr \ No newline at end of file diff --git a/contrib/try_convert/generate_test.py b/contrib/try_convert/generate_test.py index f9738120f0..3e95e9d331 100644 --- a/contrib/try_convert/generate_test.py +++ b/contrib/try_convert/generate_test.py @@ -54,6 +54,9 @@ 'uuid', 'regtype', # SYSTEM + 'regproc', + 'regclass', + 'oid', 'citext', ] diff --git a/contrib/try_convert/input/try_convert.source b/contrib/try_convert/input/try_convert.source index 9d8d887710..162af8532e 100644 --- a/contrib/try_convert/input/try_convert.source +++ b/contrib/try_convert/input/try_convert.source @@ -1,6 +1,6 @@ -- SCRIPT-GENERATED TEST for TRY_CONVERT --- Tests 31 types of 91 from pg_types.h --- Tests 111 cast of 206 from pg_cast.h +-- Tests 34 types of 91 from pg_types.h +-- Tests 134 cast of 206 from pg_cast.h -- Tests 1 types of 1 from extensions -- Tests 5 casts of 8 from extensions @@ -11,7 +11,7 @@ set search_path = tryconvert; CREATE EXTENSION IF NOT EXISTS try_convert; -- end_ignore -select add_type_for_try_convert('int8'::regtype);select add_type_for_try_convert('int4'::regtype);select add_type_for_try_convert('int2'::regtype);select add_type_for_try_convert('float8'::regtype);select add_type_for_try_convert('float4'::regtype);select add_type_for_try_convert('numeric'::regtype);select add_type_for_try_convert('complex'::regtype);select add_type_for_try_convert('bool'::regtype);select add_type_for_try_convert('bit'::regtype);select add_type_for_try_convert('varbit'::regtype);select add_type_for_try_convert('date'::regtype);select add_type_for_try_convert('time'::regtype);select add_type_for_try_convert('timetz'::regtype);select add_type_for_try_convert('timestamp'::regtype);select add_type_for_try_convert('timestamptz'::regtype);select add_type_for_try_convert('interval'::regtype);select add_type_for_try_convert('abstime'::regtype);select add_type_for_try_convert('reltime'::regtype);select add_type_for_try_convert('point'::regtype);select add_type_for_try_convert('cidr'::regtype);select add_type_for_try_convert('inet'::regtype);select add_type_for_try_convert('macaddr'::regtype);select add_type_for_try_convert('json'::regtype);select add_type_for_try_convert('jsonb'::regtype);select add_type_for_try_convert('xml'::regtype);select add_type_for_try_convert('char'::regtype);select add_type_for_try_convert('varchar'::regtype);select add_type_for_try_convert('text'::regtype);select add_type_for_try_convert('money'::regtype);select add_type_for_try_convert('uuid'::regtype);select add_type_for_try_convert('regtype'::regtype);select add_type_for_try_convert('citext'::regtype);-- start_ignore +select add_type_for_try_convert('int8'::regtype);select add_type_for_try_convert('int4'::regtype);select add_type_for_try_convert('int2'::regtype);select add_type_for_try_convert('float8'::regtype);select add_type_for_try_convert('float4'::regtype);select add_type_for_try_convert('numeric'::regtype);select add_type_for_try_convert('complex'::regtype);select add_type_for_try_convert('bool'::regtype);select add_type_for_try_convert('bit'::regtype);select add_type_for_try_convert('varbit'::regtype);select add_type_for_try_convert('date'::regtype);select add_type_for_try_convert('time'::regtype);select add_type_for_try_convert('timetz'::regtype);select add_type_for_try_convert('timestamp'::regtype);select add_type_for_try_convert('timestamptz'::regtype);select add_type_for_try_convert('interval'::regtype);select add_type_for_try_convert('abstime'::regtype);select add_type_for_try_convert('reltime'::regtype);select add_type_for_try_convert('point'::regtype);select add_type_for_try_convert('cidr'::regtype);select add_type_for_try_convert('inet'::regtype);select add_type_for_try_convert('macaddr'::regtype);select add_type_for_try_convert('json'::regtype);select add_type_for_try_convert('jsonb'::regtype);select add_type_for_try_convert('xml'::regtype);select add_type_for_try_convert('char'::regtype);select add_type_for_try_convert('varchar'::regtype);select add_type_for_try_convert('text'::regtype);select add_type_for_try_convert('money'::regtype);select add_type_for_try_convert('uuid'::regtype);select add_type_for_try_convert('regtype'::regtype);select add_type_for_try_convert('regproc'::regtype);select add_type_for_try_convert('regclass'::regtype);select add_type_for_try_convert('oid'::regtype);select add_type_for_try_convert('citext'::regtype);-- start_ignore CREATE EXTENSION IF NOT EXISTS citext; -- end_ignore @@ -655,6 +655,66 @@ $func$ -- do nothing: _out already carries default END $func$; +CREATE FUNCTION try_convert_by_sql_with_len_out(_in regproc, INOUT _out ANYELEMENT, len_out int) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::regproc::%s(%s)', $1, pg_typeof(_out), len_out::text) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; +CREATE FUNCTION try_convert_by_sql(_in regproc, INOUT _out ANYELEMENT) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::regproc::%s', $1, pg_typeof(_out)) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; +CREATE FUNCTION try_convert_by_sql_with_len_out(_in regclass, INOUT _out ANYELEMENT, len_out int) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::regclass::%s(%s)', $1, pg_typeof(_out), len_out::text) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; +CREATE FUNCTION try_convert_by_sql(_in regclass, INOUT _out ANYELEMENT) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::regclass::%s', $1, pg_typeof(_out)) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; +CREATE FUNCTION try_convert_by_sql_with_len_out(_in oid, INOUT _out ANYELEMENT, len_out int) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::oid::%s(%s)', $1, pg_typeof(_out), len_out::text) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; +CREATE FUNCTION try_convert_by_sql(_in oid, INOUT _out ANYELEMENT) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::oid::%s', $1, pg_typeof(_out)) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; CREATE FUNCTION try_convert_by_sql_with_len_out(_in citext, INOUT _out ANYELEMENT, len_out int) LANGUAGE plpgsql AS $func$ @@ -1994,6 +2054,90 @@ CREATE TABLE tt_varchar_10_of_regtype (id serial, v varchar(10)) DISTRIBUTED BY INSERT INTO tt_varchar_10_of_regtype(id, v) SELECT row_number() OVER(), v::varchar(10) from tt_temp; CREATE TABLE tt_varchar_20_of_regtype (id serial, v varchar(20)) DISTRIBUTED BY (id); INSERT INTO tt_varchar_20_of_regtype(id, v) SELECT row_number() OVER(), v::varchar(20) from tt_temp; +CREATE TABLE tt_regproc (id serial, v regproc) DISTRIBUTED BY (id); +DELETE FROM tt_temp; +COPY tt_temp from '@abs_srcdir@/data/tt_regproc.data'; +INSERT INTO tt_regproc(id, v) SELECT row_number() OVER(), v::regproc from tt_temp; +CREATE TABLE tt_text_of_regproc (id serial, v text) DISTRIBUTED BY (id); +INSERT INTO tt_text_of_regproc(id, v) SELECT row_number() OVER(), v::text from tt_temp; +CREATE TABLE tt_citext_of_regproc (id serial, v citext) DISTRIBUTED BY (id); +INSERT INTO tt_citext_of_regproc(id, v) SELECT row_number() OVER(), v::citext from tt_temp; +CREATE TABLE tt_char_of_regproc (id serial, v char) DISTRIBUTED BY (id); +INSERT INTO tt_char_of_regproc(id, v) SELECT row_number() OVER(), v::char from tt_temp; +CREATE TABLE tt_char_1_of_regproc (id serial, v char(1)) DISTRIBUTED BY (id); +INSERT INTO tt_char_1_of_regproc(id, v) SELECT row_number() OVER(), v::char(1) from tt_temp; +CREATE TABLE tt_char_5_of_regproc (id serial, v char(5)) DISTRIBUTED BY (id); +INSERT INTO tt_char_5_of_regproc(id, v) SELECT row_number() OVER(), v::char(5) from tt_temp; +CREATE TABLE tt_char_10_of_regproc (id serial, v char(10)) DISTRIBUTED BY (id); +INSERT INTO tt_char_10_of_regproc(id, v) SELECT row_number() OVER(), v::char(10) from tt_temp; +CREATE TABLE tt_char_20_of_regproc (id serial, v char(20)) DISTRIBUTED BY (id); +INSERT INTO tt_char_20_of_regproc(id, v) SELECT row_number() OVER(), v::char(20) from tt_temp; +CREATE TABLE tt_varchar_of_regproc (id serial, v varchar) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_of_regproc(id, v) SELECT row_number() OVER(), v::varchar from tt_temp; +CREATE TABLE tt_varchar_1_of_regproc (id serial, v varchar(1)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_1_of_regproc(id, v) SELECT row_number() OVER(), v::varchar(1) from tt_temp; +CREATE TABLE tt_varchar_5_of_regproc (id serial, v varchar(5)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_5_of_regproc(id, v) SELECT row_number() OVER(), v::varchar(5) from tt_temp; +CREATE TABLE tt_varchar_10_of_regproc (id serial, v varchar(10)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_10_of_regproc(id, v) SELECT row_number() OVER(), v::varchar(10) from tt_temp; +CREATE TABLE tt_varchar_20_of_regproc (id serial, v varchar(20)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_20_of_regproc(id, v) SELECT row_number() OVER(), v::varchar(20) from tt_temp; +CREATE TABLE tt_regclass (id serial, v regclass) DISTRIBUTED BY (id); +DELETE FROM tt_temp; +COPY tt_temp from '@abs_srcdir@/data/tt_regclass.data'; +INSERT INTO tt_regclass(id, v) SELECT row_number() OVER(), v::regclass from tt_temp; +CREATE TABLE tt_text_of_regclass (id serial, v text) DISTRIBUTED BY (id); +INSERT INTO tt_text_of_regclass(id, v) SELECT row_number() OVER(), v::text from tt_temp; +CREATE TABLE tt_citext_of_regclass (id serial, v citext) DISTRIBUTED BY (id); +INSERT INTO tt_citext_of_regclass(id, v) SELECT row_number() OVER(), v::citext from tt_temp; +CREATE TABLE tt_char_of_regclass (id serial, v char) DISTRIBUTED BY (id); +INSERT INTO tt_char_of_regclass(id, v) SELECT row_number() OVER(), v::char from tt_temp; +CREATE TABLE tt_char_1_of_regclass (id serial, v char(1)) DISTRIBUTED BY (id); +INSERT INTO tt_char_1_of_regclass(id, v) SELECT row_number() OVER(), v::char(1) from tt_temp; +CREATE TABLE tt_char_5_of_regclass (id serial, v char(5)) DISTRIBUTED BY (id); +INSERT INTO tt_char_5_of_regclass(id, v) SELECT row_number() OVER(), v::char(5) from tt_temp; +CREATE TABLE tt_char_10_of_regclass (id serial, v char(10)) DISTRIBUTED BY (id); +INSERT INTO tt_char_10_of_regclass(id, v) SELECT row_number() OVER(), v::char(10) from tt_temp; +CREATE TABLE tt_char_20_of_regclass (id serial, v char(20)) DISTRIBUTED BY (id); +INSERT INTO tt_char_20_of_regclass(id, v) SELECT row_number() OVER(), v::char(20) from tt_temp; +CREATE TABLE tt_varchar_of_regclass (id serial, v varchar) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_of_regclass(id, v) SELECT row_number() OVER(), v::varchar from tt_temp; +CREATE TABLE tt_varchar_1_of_regclass (id serial, v varchar(1)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_1_of_regclass(id, v) SELECT row_number() OVER(), v::varchar(1) from tt_temp; +CREATE TABLE tt_varchar_5_of_regclass (id serial, v varchar(5)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_5_of_regclass(id, v) SELECT row_number() OVER(), v::varchar(5) from tt_temp; +CREATE TABLE tt_varchar_10_of_regclass (id serial, v varchar(10)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_10_of_regclass(id, v) SELECT row_number() OVER(), v::varchar(10) from tt_temp; +CREATE TABLE tt_varchar_20_of_regclass (id serial, v varchar(20)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_20_of_regclass(id, v) SELECT row_number() OVER(), v::varchar(20) from tt_temp; +CREATE TABLE tt_oid (id serial, v oid) DISTRIBUTED BY (id); +DELETE FROM tt_temp; +COPY tt_temp from '@abs_srcdir@/data/tt_oid.data'; +INSERT INTO tt_oid(id, v) SELECT row_number() OVER(), v::oid from tt_temp; +CREATE TABLE tt_text_of_oid (id serial, v text) DISTRIBUTED BY (id); +INSERT INTO tt_text_of_oid(id, v) SELECT row_number() OVER(), v::text from tt_temp; +CREATE TABLE tt_citext_of_oid (id serial, v citext) DISTRIBUTED BY (id); +INSERT INTO tt_citext_of_oid(id, v) SELECT row_number() OVER(), v::citext from tt_temp; +CREATE TABLE tt_char_of_oid (id serial, v char) DISTRIBUTED BY (id); +INSERT INTO tt_char_of_oid(id, v) SELECT row_number() OVER(), v::char from tt_temp; +CREATE TABLE tt_char_1_of_oid (id serial, v char(1)) DISTRIBUTED BY (id); +INSERT INTO tt_char_1_of_oid(id, v) SELECT row_number() OVER(), v::char(1) from tt_temp; +CREATE TABLE tt_char_5_of_oid (id serial, v char(5)) DISTRIBUTED BY (id); +INSERT INTO tt_char_5_of_oid(id, v) SELECT row_number() OVER(), v::char(5) from tt_temp; +CREATE TABLE tt_char_10_of_oid (id serial, v char(10)) DISTRIBUTED BY (id); +INSERT INTO tt_char_10_of_oid(id, v) SELECT row_number() OVER(), v::char(10) from tt_temp; +CREATE TABLE tt_char_20_of_oid (id serial, v char(20)) DISTRIBUTED BY (id); +INSERT INTO tt_char_20_of_oid(id, v) SELECT row_number() OVER(), v::char(20) from tt_temp; +CREATE TABLE tt_varchar_of_oid (id serial, v varchar) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_of_oid(id, v) SELECT row_number() OVER(), v::varchar from tt_temp; +CREATE TABLE tt_varchar_1_of_oid (id serial, v varchar(1)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_1_of_oid(id, v) SELECT row_number() OVER(), v::varchar(1) from tt_temp; +CREATE TABLE tt_varchar_5_of_oid (id serial, v varchar(5)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_5_of_oid(id, v) SELECT row_number() OVER(), v::varchar(5) from tt_temp; +CREATE TABLE tt_varchar_10_of_oid (id serial, v varchar(10)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_10_of_oid(id, v) SELECT row_number() OVER(), v::varchar(10) from tt_temp; +CREATE TABLE tt_varchar_20_of_oid (id serial, v varchar(20)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_20_of_oid(id, v) SELECT row_number() OVER(), v::varchar(20) from tt_temp; CREATE TABLE tt_citext (id serial, v citext) DISTRIBUTED BY (id); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_citext.data'; @@ -2306,6 +2450,24 @@ select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_text_of_regtype) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_regtype) as t(v)) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_regtype) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_text_of_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_text_of_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_regproc) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_regproc) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_text_of_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_text_of_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_regclass) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_regclass) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_text_of_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_text_of_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_oid) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_oid) as t(v)) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_citext) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_citext) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_text_of_citext) as t(v1, v2) where v1 is distinct from v2; @@ -2594,6 +2756,24 @@ select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_citext_of_regtype) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_regtype) as t(v)) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_regtype) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_citext_of_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_citext_of_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_regproc) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_regproc) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_citext_of_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_citext_of_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_regclass) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_regclass) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_citext_of_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_citext_of_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_oid) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_oid) as t(v)) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_citext) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_citext) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_citext_of_citext) as t(v1, v2) where v1 is distinct from v2; @@ -2882,6 +3062,24 @@ select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_char_of_regtype) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_regtype) as t(v)) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_regtype) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_char_of_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_char_of_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_regproc) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_regproc) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_char_of_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_char_of_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_regclass) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_regclass) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_char_of_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_char_of_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_oid) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_oid) as t(v)) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_citext) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_citext) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_char_of_citext) as t(v1, v2) where v1 is distinct from v2; @@ -3170,6 +3368,24 @@ select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_varchar_of_regtype) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_regtype) as t(v)) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_regtype) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_varchar_of_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_varchar_of_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_regproc) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_regproc) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_varchar_of_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_varchar_of_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_regclass) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_regclass) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_varchar_of_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_varchar_of_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_oid) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_oid) as t(v)) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_citext) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_citext) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_varchar_of_citext) as t(v1, v2) where v1 is distinct from v2; @@ -3321,6 +3537,90 @@ select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NU select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_bool) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_bool) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_bool) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; @@ -3341,6 +3641,30 @@ select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NU select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_text) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_text) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_text) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_text) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_varchar) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_varchar) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(1)'::text) as v2 from tt_varchar_1) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(1)'::text) as v2 from tt_varchar_1) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(5)'::text) as v2 from tt_varchar_5) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(5)'::text) as v2 from tt_varchar_5) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(10)'::text) as v2 from tt_varchar_10) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(10)'::text) as v2 from tt_varchar_10) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(20)'::text) as v2 from tt_varchar_20) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(20)'::text) as v2 from tt_varchar_20) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_varchar) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_varchar) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(1)'::text) as v2 from tt_varchar_1) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(1)'::text) as v2 from tt_varchar_1) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(5)'::text) as v2 from tt_varchar_5) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(5)'::text) as v2 from tt_varchar_5) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(10)'::text) as v2 from tt_varchar_10) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(10)'::text) as v2 from tt_varchar_10) as t(v1, v2) where v1 is not distinct from v2; +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(20)'::text) as v2 from tt_varchar_20) as t(v1, v2) where v1 is distinct from v2; +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(20)'::text) as v2 from tt_varchar_20) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_text) as t(v1, v2) where v1 is distinct from v2; select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_text) as t(v1, v2) where v1 is not distinct from v2; select * from (select try_convert(v, NULL::varchar(1)) as v1, try_convert_by_sql_with_len_out(v, NULL::varchar, 1) as v2 from tt_text) as t(v1, v2) where v1 is distinct from v2; diff --git a/contrib/try_convert/output/try_convert.source b/contrib/try_convert/output/try_convert.source index a62fffebab..b84f96a441 100644 --- a/contrib/try_convert/output/try_convert.source +++ b/contrib/try_convert/output/try_convert.source @@ -1,6 +1,6 @@ -- SCRIPT-GENERATED TEST for TRY_CONVERT --- Tests 31 types of 91 from pg_types.h --- Tests 111 cast of 206 from pg_cast.h +-- Tests 34 types of 91 from pg_types.h +-- Tests 134 cast of 206 from pg_cast.h -- Tests 1 types of 1 from extensions -- Tests 5 casts of 8 from extensions create schema tryconvert; @@ -8,7 +8,7 @@ set search_path = tryconvert; -- start_ignore CREATE EXTENSION IF NOT EXISTS try_convert; -- end_ignore -select add_type_for_try_convert('int8'::regtype);select add_type_for_try_convert('int4'::regtype);select add_type_for_try_convert('int2'::regtype);select add_type_for_try_convert('float8'::regtype);select add_type_for_try_convert('float4'::regtype);select add_type_for_try_convert('numeric'::regtype);select add_type_for_try_convert('complex'::regtype);select add_type_for_try_convert('bool'::regtype);select add_type_for_try_convert('bit'::regtype);select add_type_for_try_convert('varbit'::regtype);select add_type_for_try_convert('date'::regtype);select add_type_for_try_convert('time'::regtype);select add_type_for_try_convert('timetz'::regtype);select add_type_for_try_convert('timestamp'::regtype);select add_type_for_try_convert('timestamptz'::regtype);select add_type_for_try_convert('interval'::regtype);select add_type_for_try_convert('abstime'::regtype);select add_type_for_try_convert('reltime'::regtype);select add_type_for_try_convert('point'::regtype);select add_type_for_try_convert('cidr'::regtype);select add_type_for_try_convert('inet'::regtype);select add_type_for_try_convert('macaddr'::regtype);select add_type_for_try_convert('json'::regtype);select add_type_for_try_convert('jsonb'::regtype);select add_type_for_try_convert('xml'::regtype);select add_type_for_try_convert('char'::regtype);select add_type_for_try_convert('varchar'::regtype);select add_type_for_try_convert('text'::regtype);select add_type_for_try_convert('money'::regtype);select add_type_for_try_convert('uuid'::regtype);select add_type_for_try_convert('regtype'::regtype);select add_type_for_try_convert('citext'::regtype);-- start_ignore +select add_type_for_try_convert('int8'::regtype);select add_type_for_try_convert('int4'::regtype);select add_type_for_try_convert('int2'::regtype);select add_type_for_try_convert('float8'::regtype);select add_type_for_try_convert('float4'::regtype);select add_type_for_try_convert('numeric'::regtype);select add_type_for_try_convert('complex'::regtype);select add_type_for_try_convert('bool'::regtype);select add_type_for_try_convert('bit'::regtype);select add_type_for_try_convert('varbit'::regtype);select add_type_for_try_convert('date'::regtype);select add_type_for_try_convert('time'::regtype);select add_type_for_try_convert('timetz'::regtype);select add_type_for_try_convert('timestamp'::regtype);select add_type_for_try_convert('timestamptz'::regtype);select add_type_for_try_convert('interval'::regtype);select add_type_for_try_convert('abstime'::regtype);select add_type_for_try_convert('reltime'::regtype);select add_type_for_try_convert('point'::regtype);select add_type_for_try_convert('cidr'::regtype);select add_type_for_try_convert('inet'::regtype);select add_type_for_try_convert('macaddr'::regtype);select add_type_for_try_convert('json'::regtype);select add_type_for_try_convert('jsonb'::regtype);select add_type_for_try_convert('xml'::regtype);select add_type_for_try_convert('char'::regtype);select add_type_for_try_convert('varchar'::regtype);select add_type_for_try_convert('text'::regtype);select add_type_for_try_convert('money'::regtype);select add_type_for_try_convert('uuid'::regtype);select add_type_for_try_convert('regtype'::regtype);select add_type_for_try_convert('regproc'::regtype);select add_type_for_try_convert('regclass'::regtype);select add_type_for_try_convert('oid'::regtype);select add_type_for_try_convert('citext'::regtype);-- start_ignore CREATE EXTENSION IF NOT EXISTS citext; -- end_ignore CREATE FUNCTION try_convert_by_sql_text(_in text, INOUT _out ANYELEMENT, source_type text) @@ -651,6 +651,66 @@ $func$ -- do nothing: _out already carries default END $func$; +CREATE FUNCTION try_convert_by_sql_with_len_out(_in regproc, INOUT _out ANYELEMENT, len_out int) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::regproc::%s(%s)', $1, pg_typeof(_out), len_out::text) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; +CREATE FUNCTION try_convert_by_sql(_in regproc, INOUT _out ANYELEMENT) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::regproc::%s', $1, pg_typeof(_out)) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; +CREATE FUNCTION try_convert_by_sql_with_len_out(_in regclass, INOUT _out ANYELEMENT, len_out int) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::regclass::%s(%s)', $1, pg_typeof(_out), len_out::text) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; +CREATE FUNCTION try_convert_by_sql(_in regclass, INOUT _out ANYELEMENT) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::regclass::%s', $1, pg_typeof(_out)) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; +CREATE FUNCTION try_convert_by_sql_with_len_out(_in oid, INOUT _out ANYELEMENT, len_out int) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::oid::%s(%s)', $1, pg_typeof(_out), len_out::text) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; +CREATE FUNCTION try_convert_by_sql(_in oid, INOUT _out ANYELEMENT) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::oid::%s', $1, pg_typeof(_out)) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; CREATE FUNCTION try_convert_by_sql_with_len_out(_in citext, INOUT _out ANYELEMENT, len_out int) LANGUAGE plpgsql AS $func$ @@ -1989,6 +2049,90 @@ CREATE TABLE tt_varchar_10_of_regtype (id serial, v varchar(10)) DISTRIBUTED BY INSERT INTO tt_varchar_10_of_regtype(id, v) SELECT row_number() OVER(), v::varchar(10) from tt_temp; CREATE TABLE tt_varchar_20_of_regtype (id serial, v varchar(20)) DISTRIBUTED BY (id); INSERT INTO tt_varchar_20_of_regtype(id, v) SELECT row_number() OVER(), v::varchar(20) from tt_temp; +CREATE TABLE tt_regproc (id serial, v regproc) DISTRIBUTED BY (id); +DELETE FROM tt_temp; +COPY tt_temp from '@abs_srcdir@/data/tt_regproc.data'; +INSERT INTO tt_regproc(id, v) SELECT row_number() OVER(), v::regproc from tt_temp; +CREATE TABLE tt_text_of_regproc (id serial, v text) DISTRIBUTED BY (id); +INSERT INTO tt_text_of_regproc(id, v) SELECT row_number() OVER(), v::text from tt_temp; +CREATE TABLE tt_citext_of_regproc (id serial, v citext) DISTRIBUTED BY (id); +INSERT INTO tt_citext_of_regproc(id, v) SELECT row_number() OVER(), v::citext from tt_temp; +CREATE TABLE tt_char_of_regproc (id serial, v char) DISTRIBUTED BY (id); +INSERT INTO tt_char_of_regproc(id, v) SELECT row_number() OVER(), v::char from tt_temp; +CREATE TABLE tt_char_1_of_regproc (id serial, v char(1)) DISTRIBUTED BY (id); +INSERT INTO tt_char_1_of_regproc(id, v) SELECT row_number() OVER(), v::char(1) from tt_temp; +CREATE TABLE tt_char_5_of_regproc (id serial, v char(5)) DISTRIBUTED BY (id); +INSERT INTO tt_char_5_of_regproc(id, v) SELECT row_number() OVER(), v::char(5) from tt_temp; +CREATE TABLE tt_char_10_of_regproc (id serial, v char(10)) DISTRIBUTED BY (id); +INSERT INTO tt_char_10_of_regproc(id, v) SELECT row_number() OVER(), v::char(10) from tt_temp; +CREATE TABLE tt_char_20_of_regproc (id serial, v char(20)) DISTRIBUTED BY (id); +INSERT INTO tt_char_20_of_regproc(id, v) SELECT row_number() OVER(), v::char(20) from tt_temp; +CREATE TABLE tt_varchar_of_regproc (id serial, v varchar) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_of_regproc(id, v) SELECT row_number() OVER(), v::varchar from tt_temp; +CREATE TABLE tt_varchar_1_of_regproc (id serial, v varchar(1)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_1_of_regproc(id, v) SELECT row_number() OVER(), v::varchar(1) from tt_temp; +CREATE TABLE tt_varchar_5_of_regproc (id serial, v varchar(5)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_5_of_regproc(id, v) SELECT row_number() OVER(), v::varchar(5) from tt_temp; +CREATE TABLE tt_varchar_10_of_regproc (id serial, v varchar(10)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_10_of_regproc(id, v) SELECT row_number() OVER(), v::varchar(10) from tt_temp; +CREATE TABLE tt_varchar_20_of_regproc (id serial, v varchar(20)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_20_of_regproc(id, v) SELECT row_number() OVER(), v::varchar(20) from tt_temp; +CREATE TABLE tt_regclass (id serial, v regclass) DISTRIBUTED BY (id); +DELETE FROM tt_temp; +COPY tt_temp from '@abs_srcdir@/data/tt_regclass.data'; +INSERT INTO tt_regclass(id, v) SELECT row_number() OVER(), v::regclass from tt_temp; +CREATE TABLE tt_text_of_regclass (id serial, v text) DISTRIBUTED BY (id); +INSERT INTO tt_text_of_regclass(id, v) SELECT row_number() OVER(), v::text from tt_temp; +CREATE TABLE tt_citext_of_regclass (id serial, v citext) DISTRIBUTED BY (id); +INSERT INTO tt_citext_of_regclass(id, v) SELECT row_number() OVER(), v::citext from tt_temp; +CREATE TABLE tt_char_of_regclass (id serial, v char) DISTRIBUTED BY (id); +INSERT INTO tt_char_of_regclass(id, v) SELECT row_number() OVER(), v::char from tt_temp; +CREATE TABLE tt_char_1_of_regclass (id serial, v char(1)) DISTRIBUTED BY (id); +INSERT INTO tt_char_1_of_regclass(id, v) SELECT row_number() OVER(), v::char(1) from tt_temp; +CREATE TABLE tt_char_5_of_regclass (id serial, v char(5)) DISTRIBUTED BY (id); +INSERT INTO tt_char_5_of_regclass(id, v) SELECT row_number() OVER(), v::char(5) from tt_temp; +CREATE TABLE tt_char_10_of_regclass (id serial, v char(10)) DISTRIBUTED BY (id); +INSERT INTO tt_char_10_of_regclass(id, v) SELECT row_number() OVER(), v::char(10) from tt_temp; +CREATE TABLE tt_char_20_of_regclass (id serial, v char(20)) DISTRIBUTED BY (id); +INSERT INTO tt_char_20_of_regclass(id, v) SELECT row_number() OVER(), v::char(20) from tt_temp; +CREATE TABLE tt_varchar_of_regclass (id serial, v varchar) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_of_regclass(id, v) SELECT row_number() OVER(), v::varchar from tt_temp; +CREATE TABLE tt_varchar_1_of_regclass (id serial, v varchar(1)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_1_of_regclass(id, v) SELECT row_number() OVER(), v::varchar(1) from tt_temp; +CREATE TABLE tt_varchar_5_of_regclass (id serial, v varchar(5)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_5_of_regclass(id, v) SELECT row_number() OVER(), v::varchar(5) from tt_temp; +CREATE TABLE tt_varchar_10_of_regclass (id serial, v varchar(10)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_10_of_regclass(id, v) SELECT row_number() OVER(), v::varchar(10) from tt_temp; +CREATE TABLE tt_varchar_20_of_regclass (id serial, v varchar(20)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_20_of_regclass(id, v) SELECT row_number() OVER(), v::varchar(20) from tt_temp; +CREATE TABLE tt_oid (id serial, v oid) DISTRIBUTED BY (id); +DELETE FROM tt_temp; +COPY tt_temp from '@abs_srcdir@/data/tt_oid.data'; +INSERT INTO tt_oid(id, v) SELECT row_number() OVER(), v::oid from tt_temp; +CREATE TABLE tt_text_of_oid (id serial, v text) DISTRIBUTED BY (id); +INSERT INTO tt_text_of_oid(id, v) SELECT row_number() OVER(), v::text from tt_temp; +CREATE TABLE tt_citext_of_oid (id serial, v citext) DISTRIBUTED BY (id); +INSERT INTO tt_citext_of_oid(id, v) SELECT row_number() OVER(), v::citext from tt_temp; +CREATE TABLE tt_char_of_oid (id serial, v char) DISTRIBUTED BY (id); +INSERT INTO tt_char_of_oid(id, v) SELECT row_number() OVER(), v::char from tt_temp; +CREATE TABLE tt_char_1_of_oid (id serial, v char(1)) DISTRIBUTED BY (id); +INSERT INTO tt_char_1_of_oid(id, v) SELECT row_number() OVER(), v::char(1) from tt_temp; +CREATE TABLE tt_char_5_of_oid (id serial, v char(5)) DISTRIBUTED BY (id); +INSERT INTO tt_char_5_of_oid(id, v) SELECT row_number() OVER(), v::char(5) from tt_temp; +CREATE TABLE tt_char_10_of_oid (id serial, v char(10)) DISTRIBUTED BY (id); +INSERT INTO tt_char_10_of_oid(id, v) SELECT row_number() OVER(), v::char(10) from tt_temp; +CREATE TABLE tt_char_20_of_oid (id serial, v char(20)) DISTRIBUTED BY (id); +INSERT INTO tt_char_20_of_oid(id, v) SELECT row_number() OVER(), v::char(20) from tt_temp; +CREATE TABLE tt_varchar_of_oid (id serial, v varchar) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_of_oid(id, v) SELECT row_number() OVER(), v::varchar from tt_temp; +CREATE TABLE tt_varchar_1_of_oid (id serial, v varchar(1)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_1_of_oid(id, v) SELECT row_number() OVER(), v::varchar(1) from tt_temp; +CREATE TABLE tt_varchar_5_of_oid (id serial, v varchar(5)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_5_of_oid(id, v) SELECT row_number() OVER(), v::varchar(5) from tt_temp; +CREATE TABLE tt_varchar_10_of_oid (id serial, v varchar(10)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_10_of_oid(id, v) SELECT row_number() OVER(), v::varchar(10) from tt_temp; +CREATE TABLE tt_varchar_20_of_oid (id serial, v varchar(20)) DISTRIBUTED BY (id); +INSERT INTO tt_varchar_20_of_oid(id, v) SELECT row_number() OVER(), v::varchar(20) from tt_temp; CREATE TABLE tt_citext (id serial, v citext) DISTRIBUTED BY (id); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_citext.data'; @@ -3569,6 +3713,105 @@ select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by 30 (1 row) +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_text_of_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_text_of_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_regproc) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_regproc) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_text_of_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_text_of_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_regclass) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_regclass) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_text_of_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_text_of_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_oid) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text_of_oid) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_citext) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- @@ -5153,6 +5396,105 @@ select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by 30 (1 row) +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_citext_of_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_citext_of_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_regproc) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_regproc) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_citext_of_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_citext_of_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_regclass) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_regclass) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_citext_of_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_citext_of_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_oid) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_citext_of_oid) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_citext) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- @@ -6737,133 +7079,232 @@ select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by 30 (1 row) -select * from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_citext) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_citext) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; count ------- - 70 + 11 (1 row) -select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_char_of_citext) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_char_of_regproc) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_char_of_citext) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_char_of_regproc) as t(v1, v2) where v1 is not distinct from v2; count ------- - 70 + 11 (1 row) -select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_citext) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_regproc) as t(v)) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_citext) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_regproc) as t(v)) as t(v1, v2) where v1 is not distinct from v2; count ------- - 70 + 11 (1 row) -select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; count ------- - 36 + 12 (1 row) -select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_varchar_of_int8) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_char_of_regclass) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_varchar_of_int8) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_char_of_regclass) as t(v1, v2) where v1 is not distinct from v2; count ------- - 36 + 12 (1 row) -select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int8) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_regclass) as t(v)) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int8) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_regclass) as t(v)) as t(v1, v2) where v1 is not distinct from v2; count ------- - 36 + 12 (1 row) -select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; count ------- - 27 + 13 (1 row) -select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_varchar_of_int4) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_char_of_oid) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_varchar_of_int4) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_char_of_oid) as t(v1, v2) where v1 is not distinct from v2; count ------- - 27 + 13 (1 row) -select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int4) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_oid) as t(v)) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int4) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_oid) as t(v)) as t(v1, v2) where v1 is not distinct from v2; count ------- - 27 + 13 (1 row) -select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_citext) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::char) as v1, try_convert_by_sql(v, NULL::char) as v2 from tt_citext) as t(v1, v2) where v1 is not distinct from v2; count ------- - 24 + 70 (1 row) -select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from tt_varchar_of_int2) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_char_of_citext) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from tt_varchar_of_int2) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_char_of_citext) as t(v1, v2) where v1 is not distinct from v2; count ------- - 24 + 70 (1 row) -select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int2) as t(v)) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_citext) as t(v)) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int2) as t(v)) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_char_of_citext) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 36 +(1 row) + +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_varchar_of_int8) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_varchar_of_int8) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 36 +(1 row) + +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int8) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int8) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 36 +(1 row) + +select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 27 +(1 row) + +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_varchar_of_int4) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_varchar_of_int4) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 27 +(1 row) + +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int4) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int4) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 27 +(1 row) + +select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 24 +(1 row) + +select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from tt_varchar_of_int2) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from tt_varchar_of_int2) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 24 +(1 row) + +select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int2) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_int2) as t(v)) as t(v1, v2) where v1 is not distinct from v2; count ------- 24 @@ -8321,6 +8762,105 @@ select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by 30 (1 row) +select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_varchar_of_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_varchar_of_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_regproc) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_regproc) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_varchar_of_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_varchar_of_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_regclass) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_regclass) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_varchar_of_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_varchar_of_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_oid) as t(v)) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_varchar_of_oid) as t(v)) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_citext) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- @@ -9147,114 +9687,708 @@ select count(*) from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql 19 (1 row) -select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; count ------- 36 (1 row) -select * from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; count ------- 36 (1 row) -select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; count ------- 24 (1 row) -select * from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; count ------- 24 (1 row) -select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; count ------- 27 (1 row) -select * from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; count ------- 27 (1 row) -select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; count ------- - 30 + 13 (1 row) -select * from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; count ------- - 30 + 13 (1 row) -select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; count ------- - 30 + 13 (1 row) -select * from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; +select * from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; v1 | v2 ----+---- (0 rows) -select count(*) from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; +select count(*) from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; count ------- - 30 + 13 +(1 row) + +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 36 +(1 row) + +select * from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 36 +(1 row) + +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 24 +(1 row) + +select * from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 24 +(1 row) + +select * from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regproc) as v1, try_convert_by_sql(v, NULL::regproc) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 27 +(1 row) + +select * from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'textin'::regproc) as v1, try_convert_by_sql(v, 'textin'::regproc) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 27 +(1 row) + +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regproc) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regproc) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 11 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 36 +(1 row) + +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 36 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 24 +(1 row) + +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 24 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 27 +(1 row) + +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 27 +(1 row) + +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regclass) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regclass) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 12 +(1 row) + +select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_oid) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_oid) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 13 +(1 row) + +select * from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::oid) as v1, try_convert_by_sql(v, NULL::oid) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 30 +(1 row) + +select * from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, '232'::oid) as v1, try_convert_by_sql(v, '232'::oid) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 30 +(1 row) + +select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 36 +(1 row) + +select * from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int8) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int8) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 36 +(1 row) + +select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 24 +(1 row) + +select * from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int2) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int2) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 24 +(1 row) + +select * from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regtype) as v1, try_convert_by_sql(v, NULL::regtype) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 27 +(1 row) + +select * from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int4) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'bool'::regtype) as v1, try_convert_by_sql(v, 'bool'::regtype) as v2 from tt_int4) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 27 +(1 row) + +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 30 +(1 row) + +select * from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, '2'::int8) as v1, try_convert_by_sql(v, '2'::int8) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 30 +(1 row) + +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 30 +(1 row) + +select * from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regtype) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, '9'::int4) as v1, try_convert_by_sql(v, '9'::int4) as v2 from tt_regtype) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 30 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_text) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_text) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_text) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_text) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_varchar) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql(v, NULL::regclass) as v2 from tt_varchar) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(1)'::text) as v2 from tt_varchar_1) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(1)'::text) as v2 from tt_varchar_1) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(5)'::text) as v2 from tt_varchar_5) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(5)'::text) as v2 from tt_varchar_5) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(10)'::text) as v2 from tt_varchar_10) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(10)'::text) as v2 from tt_varchar_10) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(20)'::text) as v2 from tt_varchar_20) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, NULL::regclass) as v1, try_convert_by_sql_text(v::text, NULL::regclass, 'varchar(20)'::text) as v2 from tt_varchar_20) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_varchar) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql(v, 'pg_type'::regclass) as v2 from tt_varchar) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(1)'::text) as v2 from tt_varchar_1) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(1)'::text) as v2 from tt_varchar_1) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(5)'::text) as v2 from tt_varchar_5) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(5)'::text) as v2 from tt_varchar_5) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(10)'::text) as v2 from tt_varchar_10) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(10)'::text) as v2 from tt_varchar_10) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 +(1 row) + +select * from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(20)'::text) as v2 from tt_varchar_20) as t(v1, v2) where v1 is distinct from v2; + v1 | v2 +----+---- +(0 rows) + +select count(*) from (select try_convert(v, 'pg_type'::regclass) as v1, try_convert_by_sql_text(v::text, 'pg_type'::regclass, 'varchar(20)'::text) as v2 from tt_varchar_20) as t(v1, v2) where v1 is not distinct from v2; + count +------- + 70 (1 row) select * from (select try_convert(v, NULL::varchar) as v1, try_convert_by_sql(v, NULL::varchar) as v2 from tt_text) as t(v1, v2) where v1 is distinct from v2;