diff --git a/contrib/try_convert/data/tt_citext.data b/contrib/try_convert/data/tt_citext.data new file mode 100644 index 0000000000..ea621c8662 --- /dev/null +++ b/contrib/try_convert/data/tt_citext.data @@ -0,0 +1,70 @@ +All the world's a stage, +And all the men and women merely players; +They have their exits and their entrances, +And one man in his time plays many parts, +His acts being seven ages. At first, the infant, +Mewling and puking in the nurse's arms. +Then the whining schoolboy, with his satchel +And shining morning face, creeping like snail +Unwillingly to school. And then the lover, +Sighing like furnace, with a woeful ballad +Made to his mistress' eyebrow. Then a soldier, +Full of strange oaths and bearded like the pard, +Jealous in honor, sudden and quick in quarrel, +Seeking the bubble reputation +Even in the cannon's mouth. And then the justice, +In fair round belly with good capon lined, +With eyes severe and beard of formal cut, +Full of wise saws and modern instances; +And so he plays his part. The sixth age shifts +Into the lean and slippered pantaloon, +With spectacles on nose and pouch on side; +His youthful hose, well saved, a world too wide +For his shrunk shank, and his big manly voice, +Turning again toward childish treble, pipes +And whistles in his sound. Last scene of all, +That ends this strange eventful history, +Is second childishness and mere oblivion, +Sans teeth, sans eyes, sans taste, sans everything. + +std::to_string + C++ Strings library std::basic_string +Defined in header +std::string to_string( int value ); +std::string to_string( long value ); +std::string to_string( long long value ); +std::string to_string( unsigned value ); +std::string to_string( unsigned long value ); +std::string to_string( unsigned long long value ); +std::string to_string( float value ); +std::string to_string( double value ); +std::string to_string( long double value ); +Converts a numeric value to std::string. + +Let buf be an internal to the conversion functions buffer, sufficiently large to contain the result of conversion. + +1) Converts a signed integer to a string as if by std::sprintf(buf, "%d", value). +2) Converts a signed integer to a string as if by std::sprintf(buf, "%ld", value). +3) Converts a signed integer to a string as if by std::sprintf(buf, "%lld", value). +4) Converts an unsigned integer to a string as if by std::sprintf(buf, "%u", value). +5) Converts an unsigned integer to a string as if by std::sprintf(buf, "%lu", value). +6) Converts an unsigned integer to a string as if by std::sprintf(buf, "%llu", value). +7,8) Converts a floating point value to a string as if by std::sprintf(buf, "%f", value). +9) Converts a floating point value to a string as if by std::sprintf(buf, "%Lf", value). +(until C++26) +1-9) Converts a numeric value to a string as if by std::format("{}", value). +(since C++26) +Parameters +Return value +A string holding the converted value. + +Exceptions +May throw std::bad_alloc from the std::string constructor. + +Notes +With floating point types std::to_string may yield unexpected results as the number of significant digits in the returned string can be zero, see the example. +The return value may differ significantly from what std::cout prints by default, see the example. +std::to_string relies on the current C locale for formatting purposes, and therefore concurrent calls to std::to_string from multiple threads may result in partial serialization of calls. +The results of overloads for integer types do not rely on the current C locale, and thus implementations generally avoid access to the current C locale in these overloads for both correctness and performance. However, such avoidance is not guaranteed by the standard. +(until C++26) +C++17 provides std::to_chars as a higher-performance locale-independent alternative. diff --git a/contrib/try_convert/generate_test.py b/contrib/try_convert/generate_test.py index 4a659be3ad..da271b9395 100644 --- a/contrib/try_convert/generate_test.py +++ b/contrib/try_convert/generate_test.py @@ -39,6 +39,8 @@ # # 'tsvector', # # 'txid_snapshot', # 'uuid', + + 'citext', ] uncomparable_types = [ @@ -46,6 +48,25 @@ 'xml', ] +extensions = [ + 'citext' +] + +extension_types = [ + 'citext' +] + +extension_casts = [ + ('citext', 'text'), + ('citext', 'varchar'), + ('citext', 'bpchar'), + ('text', 'citext'), + ('varchar', 'citext'), + ('bpchar', 'citext'), + ('boolean', 'citext'), + ('inet', 'citext'), +] + print('Supported types:', ' '.join(supported_types)) @@ -80,7 +101,12 @@ def remove_empty_lines(t): if name in supported_types: supported_types_count += 1 -print(f'Types found: {len(type_id_name)}, supported: {supported_types_count}') +supported_extension_types_count = 0 +for name in extension_types: + if name in extension_types: + supported_extension_types_count += 1 + +print(f'Types found: {len(type_id_name)}, supported: {supported_types_count}, from ext: {len(extension_types)}, from ext sup {supported_extension_types_count}') ### GET CONVERTS @@ -116,6 +142,12 @@ def remove_empty_lines(t): f'-- end_ignore\n' \ f'\n' \ +for extension in extensions: + test_header += \ + f'-- start_ignore\n' \ + f'CREATE EXTENSION IF NOT EXISTS {extension};\n' \ + f'-- end_ignore\n' \ + test_footer = 'reset search_path;' @@ -157,6 +189,7 @@ def remove_empty_lines(t): test_load_data = '-- LOAD DATA\n' test_load_data += f'CREATE TABLE tt_temp (v text) DISTRIBUTED BY (v);\n' +test_load_data += f'CREATE TABLE tt_temp_citext (v citext) DISTRIBUTED BY (v);\n' def copy_data(table_name, filename, type_name): return f'DELETE FROM tt_temp;' \ @@ -209,20 +242,24 @@ def create_test(source_name, target_name, test_data): text_tests_in = [] text_tests_out = [] -for type_name in supported_types: - test_type_data = get_data(type_name) +text_types = [('text', 'tt_temp'), ('citext', 'tt_temp_citext')] + +for text_type, text_type_table in text_types: - load_text_data_text = f'DELETE FROM tt_temp; COPY tt_temp from \'@abs_srcdir@/data/tt_{type_name}.data\';' - test_text_data = 'tt_temp' + for type_name in supported_types: - test_corrupted_text_data = f'(select (\'!@#%^&*\' || v || \'!@#%^&*\') from {test_type_data}) as t(v)' + test_type_data = get_data(type_name) - to_text_in, to_text_out = create_test(type_name, 'text', test_type_data) - from_text_in, from_text_out = create_test('text', type_name, test_text_data) - from_corrupted_text_in, from_corrupted_text_out = create_test('text', type_name, test_corrupted_text_data) + load_text_data_text = f'DELETE FROM {text_type_table}; COPY {text_type_table} from \'@abs_srcdir@/data/tt_{type_name}.data\';' - text_tests_in += [to_text_in, load_text_data_text, from_text_in, from_corrupted_text_in] - text_tests_out += [to_text_out, load_text_data_text, from_text_out, from_corrupted_text_out] + test_corrupted_text_data = f'(select (\'!@#%^&*\' || v || \'!@#%^&*\') from {text_type_table}) as t(v)' + + to_text_in, to_text_out = create_test(type_name, text_type, test_type_data) + from_text_in, from_text_out = create_test(text_type, type_name, text_type_table) + from_corrupted_text_in, from_corrupted_text_out = create_test(text_type, type_name, test_corrupted_text_data) + + text_tests_in += [to_text_in, load_text_data_text, from_text_in, from_corrupted_text_in] + text_tests_out += [to_text_out, load_text_data_text, from_text_out, from_corrupted_text_out] # print(text_tests_in[0]) # print(text_tests_in[1]) @@ -233,10 +270,11 @@ def create_test(source_name, target_name, test_data): function_tests_in = [] function_tests_out = [] -for (source_id, target_id, method) in casts: +type_casts = [(type_id_name[source_id], type_id_name[target_id]) for (source_id, target_id, method) in casts] \ + + extension_casts + +for source_name, target_name in type_casts: - source_name = type_id_name[source_id] - target_name = type_id_name[target_id] test_data = get_data(source_name) if (source_name not in supported_types or target_name not in supported_types): diff --git a/contrib/try_convert/input/try_convert.source b/contrib/try_convert/input/try_convert.source index 8beae3c9ab..b29e8671b1 100644 --- a/contrib/try_convert/input/try_convert.source +++ b/contrib/try_convert/input/try_convert.source @@ -9,6 +9,9 @@ set search_path = tryconvert; CREATE EXTENSION IF NOT EXISTS try_convert; -- end_ignore +-- start_ignore +CREATE EXTENSION IF NOT EXISTS citext; +-- end_ignore CREATE OR REPLACE FUNCTION try_convert_by_sql(_in int8, INOUT _out ANYELEMENT) LANGUAGE plpgsql AS @@ -220,9 +223,20 @@ $func$ -- do nothing: _out already carries default END $func$; +CREATE OR REPLACE FUNCTION try_convert_by_sql(_in citext, INOUT _out ANYELEMENT) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::%s', $1, source_type) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; -- LOAD DATA CREATE TABLE tt_temp (v text) DISTRIBUTED BY (v); +CREATE TABLE tt_temp_citext (v citext) DISTRIBUTED BY (v); CREATE TABLE tt_int8 (id serial, v int8) DISTRIBUTED BY (id); DELETE FROM tt_temp;COPY tt_temp from '@abs_srcdir@/data/tt_int8.data'; INSERT INTO tt_int8(id, v) SELECT row_number() OVER(), v::int8 from tt_temp; @@ -286,92 +300,187 @@ INSERT INTO tt_text(id, v) SELECT row_number() OVER(), v::text from tt_temp; CREATE TABLE tt_money (id serial, v money) DISTRIBUTED BY (id); DELETE FROM tt_temp;COPY tt_temp from '@abs_srcdir@/data/tt_money.data'; INSERT INTO tt_money(id, v) SELECT row_number() OVER(), v::money 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'; +INSERT INTO tt_citext(id, v) SELECT row_number() OVER(), v::citext from tt_temp; -- TEXT TESTS select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_int8) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_int8.data'; select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_int8) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_int4) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_int4.data'; select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_int4) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_int2) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_int2.data'; select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_int2) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_float8) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_float8.data'; select * from (select try_convert(v, NULL::float8) as v1, try_convert_by_sql(v, NULL::float8) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::float8) as v1, try_convert_by_sql(v, NULL::float8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_float8) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::float8) as v1, try_convert_by_sql(v, NULL::float8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_float4) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_float4.data'; select * from (select try_convert(v, NULL::float4) as v1, try_convert_by_sql(v, NULL::float4) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::float4) as v1, try_convert_by_sql(v, NULL::float4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_float4) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::float4) as v1, try_convert_by_sql(v, NULL::float4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_numeric) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_numeric.data'; select * from (select try_convert(v, NULL::numeric) as v1, try_convert_by_sql(v, NULL::numeric) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::numeric) as v1, try_convert_by_sql(v, NULL::numeric) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_numeric) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::numeric) as v1, try_convert_by_sql(v, NULL::numeric) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_bool) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_bool.data'; select * from (select try_convert(v, NULL::bool) as v1, try_convert_by_sql(v, NULL::bool) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::bool) as v1, try_convert_by_sql(v, NULL::bool) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_bool) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::bool) as v1, try_convert_by_sql(v, NULL::bool) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_date) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_date.data'; select * from (select try_convert(v, NULL::date) as v1, try_convert_by_sql(v, NULL::date) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::date) as v1, try_convert_by_sql(v, NULL::date) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_date) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::date) as v1, try_convert_by_sql(v, NULL::date) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_time) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_time.data'; select * from (select try_convert(v, NULL::time) as v1, try_convert_by_sql(v, NULL::time) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::time) as v1, try_convert_by_sql(v, NULL::time) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_time) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::time) as v1, try_convert_by_sql(v, NULL::time) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_timetz) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_timetz.data'; select * from (select try_convert(v, NULL::timetz) as v1, try_convert_by_sql(v, NULL::timetz) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::timetz) as v1, try_convert_by_sql(v, NULL::timetz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_timetz) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::timetz) as v1, try_convert_by_sql(v, NULL::timetz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_timestamp) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_timestamp.data'; select * from (select try_convert(v, NULL::timestamp) as v1, try_convert_by_sql(v, NULL::timestamp) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::timestamp) as v1, try_convert_by_sql(v, NULL::timestamp) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_timestamp) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::timestamp) as v1, try_convert_by_sql(v, NULL::timestamp) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_timestamptz) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_timestamptz.data'; select * from (select try_convert(v, NULL::timestamptz) as v1, try_convert_by_sql(v, NULL::timestamptz) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::timestamptz) as v1, try_convert_by_sql(v, NULL::timestamptz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_timestamptz) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::timestamptz) as v1, try_convert_by_sql(v, NULL::timestamptz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_interval) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_interval.data'; select * from (select try_convert(v, NULL::interval) as v1, try_convert_by_sql(v, NULL::interval) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::interval) as v1, try_convert_by_sql(v, NULL::interval) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_interval) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::interval) as v1, try_convert_by_sql(v, NULL::interval) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_cidr) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_cidr.data'; select * from (select try_convert(v, NULL::cidr) as v1, try_convert_by_sql(v, NULL::cidr) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::cidr) as v1, try_convert_by_sql(v, NULL::cidr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_cidr) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::cidr) as v1, try_convert_by_sql(v, NULL::cidr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_inet) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_inet.data'; select * from (select try_convert(v, NULL::inet) as v1, try_convert_by_sql(v, NULL::inet) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::inet) as v1, try_convert_by_sql(v, NULL::inet) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_inet) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::inet) as v1, try_convert_by_sql(v, NULL::inet) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_macaddr) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_macaddr.data'; select * from (select try_convert(v, NULL::macaddr) as v1, try_convert_by_sql(v, NULL::macaddr) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::macaddr) as v1, try_convert_by_sql(v, NULL::macaddr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_macaddr) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::macaddr) as v1, try_convert_by_sql(v, NULL::macaddr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_json) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_json.data'; select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NULL::json) as v2 from tt_temp) as t(v1, v2) where not (v1::text = v2::text); -select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NULL::json) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_json) as t(v)) as t(v1, v2) where not (v1::text = v2::text); +select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NULL::json) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1::text = v2::text); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_jsonb) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_jsonb.data'; select * from (select try_convert(v, NULL::jsonb) as v1, try_convert_by_sql(v, NULL::jsonb) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::jsonb) as v1, try_convert_by_sql(v, NULL::jsonb) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_jsonb) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::jsonb) as v1, try_convert_by_sql(v, NULL::jsonb) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_xml) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_xml.data'; select * from (select try_convert(v, NULL::xml) as v1, try_convert_by_sql(v, NULL::xml) as v2 from tt_temp) as t(v1, v2) where not (v1::text = v2::text); -select * from (select try_convert(v, NULL::xml) as v1, try_convert_by_sql(v, NULL::xml) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_xml) as t(v)) as t(v1, v2) where not (v1::text = v2::text); +select * from (select try_convert(v, NULL::xml) as v1, try_convert_by_sql(v, NULL::xml) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1::text = v2::text); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_text) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_text.data'; select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_money) as t(v1, v2) where not (v1 = v2); DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_money.data'; select * from (select try_convert(v, NULL::money) as v1, try_convert_by_sql(v, NULL::money) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); -select * from (select try_convert(v, NULL::money) as v1, try_convert_by_sql(v, NULL::money) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_money) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::money) as v1, try_convert_by_sql(v, NULL::money) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = 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 not (v1 = v2); +DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_citext.data'; +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_temp) as t(v1, v2) where not (v1 = 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_temp) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_int8) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_int8.data'; +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_int4) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_int4.data'; +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_int2) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_int2.data'; +select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_float8) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_float8.data'; +select * from (select try_convert(v, NULL::float8) as v1, try_convert_by_sql(v, NULL::float8) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::float8) as v1, try_convert_by_sql(v, NULL::float8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_float4) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_float4.data'; +select * from (select try_convert(v, NULL::float4) as v1, try_convert_by_sql(v, NULL::float4) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::float4) as v1, try_convert_by_sql(v, NULL::float4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_numeric) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_numeric.data'; +select * from (select try_convert(v, NULL::numeric) as v1, try_convert_by_sql(v, NULL::numeric) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::numeric) as v1, try_convert_by_sql(v, NULL::numeric) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_bool) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_bool.data'; +select * from (select try_convert(v, NULL::bool) as v1, try_convert_by_sql(v, NULL::bool) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::bool) as v1, try_convert_by_sql(v, NULL::bool) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_date) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_date.data'; +select * from (select try_convert(v, NULL::date) as v1, try_convert_by_sql(v, NULL::date) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::date) as v1, try_convert_by_sql(v, NULL::date) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_time) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_time.data'; +select * from (select try_convert(v, NULL::time) as v1, try_convert_by_sql(v, NULL::time) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::time) as v1, try_convert_by_sql(v, NULL::time) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_timetz) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_timetz.data'; +select * from (select try_convert(v, NULL::timetz) as v1, try_convert_by_sql(v, NULL::timetz) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::timetz) as v1, try_convert_by_sql(v, NULL::timetz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_timestamp) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_timestamp.data'; +select * from (select try_convert(v, NULL::timestamp) as v1, try_convert_by_sql(v, NULL::timestamp) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::timestamp) as v1, try_convert_by_sql(v, NULL::timestamp) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_timestamptz) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_timestamptz.data'; +select * from (select try_convert(v, NULL::timestamptz) as v1, try_convert_by_sql(v, NULL::timestamptz) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::timestamptz) as v1, try_convert_by_sql(v, NULL::timestamptz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_interval) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_interval.data'; +select * from (select try_convert(v, NULL::interval) as v1, try_convert_by_sql(v, NULL::interval) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::interval) as v1, try_convert_by_sql(v, NULL::interval) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_cidr) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_cidr.data'; +select * from (select try_convert(v, NULL::cidr) as v1, try_convert_by_sql(v, NULL::cidr) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::cidr) as v1, try_convert_by_sql(v, NULL::cidr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_inet) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_inet.data'; +select * from (select try_convert(v, NULL::inet) as v1, try_convert_by_sql(v, NULL::inet) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::inet) as v1, try_convert_by_sql(v, NULL::inet) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_macaddr) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_macaddr.data'; +select * from (select try_convert(v, NULL::macaddr) as v1, try_convert_by_sql(v, NULL::macaddr) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::macaddr) as v1, try_convert_by_sql(v, NULL::macaddr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_json) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_json.data'; +select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NULL::json) as v2 from tt_temp_citext) as t(v1, v2) where not (v1::text = v2::text); +select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NULL::json) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1::text = v2::text); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_jsonb) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_jsonb.data'; +select * from (select try_convert(v, NULL::jsonb) as v1, try_convert_by_sql(v, NULL::jsonb) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::jsonb) as v1, try_convert_by_sql(v, NULL::jsonb) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_xml) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_xml.data'; +select * from (select try_convert(v, NULL::xml) as v1, try_convert_by_sql(v, NULL::xml) as v2 from tt_temp_citext) as t(v1, v2) where not (v1::text = v2::text); +select * from (select try_convert(v, NULL::xml) as v1, try_convert_by_sql(v, NULL::xml) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1::text = v2::text); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_text) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_text.data'; +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_money) as t(v1, v2) where not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_money.data'; +select * from (select try_convert(v, NULL::money) as v1, try_convert_by_sql(v, NULL::money) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::money) as v1, try_convert_by_sql(v, NULL::money) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = 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 not (v1 = v2); +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_citext.data'; +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = 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_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); -- FUNCTION TESTS select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from tt_int8) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_int8) as t(v1, v2) where not (v1 = v2); @@ -437,4 +546,7 @@ select * from (select try_convert(v, NULL::timetz) as v1, try_convert_by_sql(v, select * from (select try_convert(v, NULL::numeric) as v1, try_convert_by_sql(v, NULL::numeric) as v2 from tt_numeric) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::jsonb) as v1, try_convert_by_sql(v, NULL::jsonb) as v2 from tt_json) as t(v1, v2) where not (v1 = v2); select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NULL::json) as v2 from tt_jsonb) as t(v1, v2) where not (v1::text = v2::text); +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 not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_text) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_inet) as t(v1, v2) where not (v1 = v2); reset search_path; diff --git a/contrib/try_convert/output/try_convert.source b/contrib/try_convert/output/try_convert.source index b29d9fecff..4b7526e786 100644 --- a/contrib/try_convert/output/try_convert.source +++ b/contrib/try_convert/output/try_convert.source @@ -6,6 +6,9 @@ set search_path = tryconvert; -- start_ignore CREATE EXTENSION IF NOT EXISTS try_convert; -- end_ignore +-- start_ignore +CREATE EXTENSION IF NOT EXISTS citext; +-- end_ignore CREATE OR REPLACE FUNCTION try_convert_by_sql(_in int8, INOUT _out ANYELEMENT) LANGUAGE plpgsql AS $func$ @@ -216,8 +219,19 @@ $func$ -- do nothing: _out already carries default END $func$; +CREATE OR REPLACE FUNCTION try_convert_by_sql(_in citext, INOUT _out ANYELEMENT) + LANGUAGE plpgsql AS +$func$ + BEGIN + EXECUTE format('SELECT %L::%s', $1, source_type) + INTO _out; + EXCEPTION WHEN others THEN + -- do nothing: _out already carries default + END +$func$; -- LOAD DATA CREATE TABLE tt_temp (v text) DISTRIBUTED BY (v); +CREATE TABLE tt_temp_citext (v citext) DISTRIBUTED BY (v); CREATE TABLE tt_int8 (id serial, v int8) DISTRIBUTED BY (id); DELETE FROM tt_temp;COPY tt_temp from '@abs_srcdir@/data/tt_int8.data'; INSERT INTO tt_int8(id, v) SELECT row_number() OVER(), v::int8 from tt_temp; @@ -281,6 +295,9 @@ INSERT INTO tt_text(id, v) SELECT row_number() OVER(), v::text from tt_temp; CREATE TABLE tt_money (id serial, v money) DISTRIBUTED BY (id); DELETE FROM tt_temp;COPY tt_temp from '@abs_srcdir@/data/tt_money.data'; INSERT INTO tt_money(id, v) SELECT row_number() OVER(), v::money 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'; +INSERT INTO tt_citext(id, v) SELECT row_number() OVER(), v::citext from tt_temp; -- TEXT TESTS select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_int8) as t(v1, v2) where not (v1 = v2); v1 | v2 @@ -293,7 +310,7 @@ select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NU ----+---- (0 rows) -select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_int8) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -309,7 +326,7 @@ select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NU ----+---- (0 rows) -select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_int4) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -325,7 +342,7 @@ select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NU ----+---- (0 rows) -select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_int2) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -341,7 +358,7 @@ select * from (select try_convert(v, NULL::float8) as v1, try_convert_by_sql(v, ----+---- (0 rows) -select * from (select try_convert(v, NULL::float8) as v1, try_convert_by_sql(v, NULL::float8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_float8) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::float8) as v1, try_convert_by_sql(v, NULL::float8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -357,7 +374,7 @@ select * from (select try_convert(v, NULL::float4) as v1, try_convert_by_sql(v, ----+---- (0 rows) -select * from (select try_convert(v, NULL::float4) as v1, try_convert_by_sql(v, NULL::float4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_float4) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::float4) as v1, try_convert_by_sql(v, NULL::float4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -373,7 +390,7 @@ select * from (select try_convert(v, NULL::numeric) as v1, try_convert_by_sql(v, ----+---- (0 rows) -select * from (select try_convert(v, NULL::numeric) as v1, try_convert_by_sql(v, NULL::numeric) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_numeric) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::numeric) as v1, try_convert_by_sql(v, NULL::numeric) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -389,7 +406,7 @@ select * from (select try_convert(v, NULL::bool) as v1, try_convert_by_sql(v, NU ----+---- (0 rows) -select * from (select try_convert(v, NULL::bool) as v1, try_convert_by_sql(v, NULL::bool) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_bool) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::bool) as v1, try_convert_by_sql(v, NULL::bool) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -405,7 +422,7 @@ select * from (select try_convert(v, NULL::date) as v1, try_convert_by_sql(v, NU ----+---- (0 rows) -select * from (select try_convert(v, NULL::date) as v1, try_convert_by_sql(v, NULL::date) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_date) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::date) as v1, try_convert_by_sql(v, NULL::date) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -421,7 +438,7 @@ select * from (select try_convert(v, NULL::time) as v1, try_convert_by_sql(v, NU ----+---- (0 rows) -select * from (select try_convert(v, NULL::time) as v1, try_convert_by_sql(v, NULL::time) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_time) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::time) as v1, try_convert_by_sql(v, NULL::time) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -437,7 +454,7 @@ select * from (select try_convert(v, NULL::timetz) as v1, try_convert_by_sql(v, ----+---- (0 rows) -select * from (select try_convert(v, NULL::timetz) as v1, try_convert_by_sql(v, NULL::timetz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_timetz) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::timetz) as v1, try_convert_by_sql(v, NULL::timetz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -453,7 +470,7 @@ select * from (select try_convert(v, NULL::timestamp) as v1, try_convert_by_sql( ----+---- (0 rows) -select * from (select try_convert(v, NULL::timestamp) as v1, try_convert_by_sql(v, NULL::timestamp) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_timestamp) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::timestamp) as v1, try_convert_by_sql(v, NULL::timestamp) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -469,7 +486,7 @@ select * from (select try_convert(v, NULL::timestamptz) as v1, try_convert_by_sq ----+---- (0 rows) -select * from (select try_convert(v, NULL::timestamptz) as v1, try_convert_by_sql(v, NULL::timestamptz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_timestamptz) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::timestamptz) as v1, try_convert_by_sql(v, NULL::timestamptz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -485,7 +502,7 @@ select * from (select try_convert(v, NULL::interval) as v1, try_convert_by_sql(v ----+---- (0 rows) -select * from (select try_convert(v, NULL::interval) as v1, try_convert_by_sql(v, NULL::interval) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_interval) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::interval) as v1, try_convert_by_sql(v, NULL::interval) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -501,7 +518,7 @@ select * from (select try_convert(v, NULL::cidr) as v1, try_convert_by_sql(v, NU ----+---- (0 rows) -select * from (select try_convert(v, NULL::cidr) as v1, try_convert_by_sql(v, NULL::cidr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_cidr) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::cidr) as v1, try_convert_by_sql(v, NULL::cidr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -517,7 +534,7 @@ select * from (select try_convert(v, NULL::inet) as v1, try_convert_by_sql(v, NU ----+---- (0 rows) -select * from (select try_convert(v, NULL::inet) as v1, try_convert_by_sql(v, NULL::inet) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_inet) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::inet) as v1, try_convert_by_sql(v, NULL::inet) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -533,7 +550,7 @@ select * from (select try_convert(v, NULL::macaddr) as v1, try_convert_by_sql(v, ----+---- (0 rows) -select * from (select try_convert(v, NULL::macaddr) as v1, try_convert_by_sql(v, NULL::macaddr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_macaddr) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::macaddr) as v1, try_convert_by_sql(v, NULL::macaddr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -549,7 +566,7 @@ select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NU ----+---- (0 rows) -select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NULL::json) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_json) as t(v)) as t(v1, v2) where not (v1::text = v2::text); +select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NULL::json) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1::text = v2::text); v1 | v2 ----+---- (0 rows) @@ -565,7 +582,7 @@ select * from (select try_convert(v, NULL::jsonb) as v1, try_convert_by_sql(v, N ----+---- (0 rows) -select * from (select try_convert(v, NULL::jsonb) as v1, try_convert_by_sql(v, NULL::jsonb) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_jsonb) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::jsonb) as v1, try_convert_by_sql(v, NULL::jsonb) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -581,7 +598,7 @@ select * from (select try_convert(v, NULL::xml) as v1, try_convert_by_sql(v, NUL ----+---- (0 rows) -select * from (select try_convert(v, NULL::xml) as v1, try_convert_by_sql(v, NULL::xml) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_xml) as t(v)) as t(v1, v2) where not (v1::text = v2::text); +select * from (select try_convert(v, NULL::xml) as v1, try_convert_by_sql(v, NULL::xml) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1::text = v2::text); v1 | v2 ----+---- (0 rows) @@ -597,7 +614,7 @@ select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NU ----+---- (0 rows) -select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_text) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -613,7 +630,375 @@ select * from (select try_convert(v, NULL::money) as v1, try_convert_by_sql(v, N ----+---- (0 rows) -select * from (select try_convert(v, NULL::money) as v1, try_convert_by_sql(v, NULL::money) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_money) as t(v)) as t(v1, v2) where not (v1 = v2); +select * from (select try_convert(v, NULL::money) as v1, try_convert_by_sql(v, NULL::money) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +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 not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp; COPY tt_temp from '@abs_srcdir@/data/tt_citext.data'; +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_temp) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_int8) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_int8.data'; +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::int8) as v1, try_convert_by_sql(v, NULL::int8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_int4) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_int4.data'; +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::int4) as v1, try_convert_by_sql(v, NULL::int4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_int2) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_int2.data'; +select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::int2) as v1, try_convert_by_sql(v, NULL::int2) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_float8) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_float8.data'; +select * from (select try_convert(v, NULL::float8) as v1, try_convert_by_sql(v, NULL::float8) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::float8) as v1, try_convert_by_sql(v, NULL::float8) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_float4) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_float4.data'; +select * from (select try_convert(v, NULL::float4) as v1, try_convert_by_sql(v, NULL::float4) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::float4) as v1, try_convert_by_sql(v, NULL::float4) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_numeric) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_numeric.data'; +select * from (select try_convert(v, NULL::numeric) as v1, try_convert_by_sql(v, NULL::numeric) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::numeric) as v1, try_convert_by_sql(v, NULL::numeric) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_bool) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_bool.data'; +select * from (select try_convert(v, NULL::bool) as v1, try_convert_by_sql(v, NULL::bool) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::bool) as v1, try_convert_by_sql(v, NULL::bool) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_date) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_date.data'; +select * from (select try_convert(v, NULL::date) as v1, try_convert_by_sql(v, NULL::date) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::date) as v1, try_convert_by_sql(v, NULL::date) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_time) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_time.data'; +select * from (select try_convert(v, NULL::time) as v1, try_convert_by_sql(v, NULL::time) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::time) as v1, try_convert_by_sql(v, NULL::time) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_timetz) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_timetz.data'; +select * from (select try_convert(v, NULL::timetz) as v1, try_convert_by_sql(v, NULL::timetz) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::timetz) as v1, try_convert_by_sql(v, NULL::timetz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_timestamp) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_timestamp.data'; +select * from (select try_convert(v, NULL::timestamp) as v1, try_convert_by_sql(v, NULL::timestamp) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::timestamp) as v1, try_convert_by_sql(v, NULL::timestamp) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_timestamptz) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_timestamptz.data'; +select * from (select try_convert(v, NULL::timestamptz) as v1, try_convert_by_sql(v, NULL::timestamptz) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::timestamptz) as v1, try_convert_by_sql(v, NULL::timestamptz) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_interval) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_interval.data'; +select * from (select try_convert(v, NULL::interval) as v1, try_convert_by_sql(v, NULL::interval) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::interval) as v1, try_convert_by_sql(v, NULL::interval) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_cidr) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_cidr.data'; +select * from (select try_convert(v, NULL::cidr) as v1, try_convert_by_sql(v, NULL::cidr) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::cidr) as v1, try_convert_by_sql(v, NULL::cidr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_inet) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_inet.data'; +select * from (select try_convert(v, NULL::inet) as v1, try_convert_by_sql(v, NULL::inet) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::inet) as v1, try_convert_by_sql(v, NULL::inet) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_macaddr) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_macaddr.data'; +select * from (select try_convert(v, NULL::macaddr) as v1, try_convert_by_sql(v, NULL::macaddr) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::macaddr) as v1, try_convert_by_sql(v, NULL::macaddr) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_json) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_json.data'; +select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NULL::json) as v2 from tt_temp_citext) as t(v1, v2) where not (v1::text = v2::text); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NULL::json) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1::text = v2::text); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_jsonb) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_jsonb.data'; +select * from (select try_convert(v, NULL::jsonb) as v1, try_convert_by_sql(v, NULL::jsonb) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::jsonb) as v1, try_convert_by_sql(v, NULL::jsonb) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_xml) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_xml.data'; +select * from (select try_convert(v, NULL::xml) as v1, try_convert_by_sql(v, NULL::xml) as v2 from tt_temp_citext) as t(v1, v2) where not (v1::text = v2::text); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::xml) as v1, try_convert_by_sql(v, NULL::xml) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1::text = v2::text); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_text) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_text.data'; +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::text) as v1, try_convert_by_sql(v, NULL::text) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_money) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_money.data'; +select * from (select try_convert(v, NULL::money) as v1, try_convert_by_sql(v, NULL::money) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::money) as v1, try_convert_by_sql(v, NULL::money) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +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 not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +DELETE FROM tt_temp_citext; COPY tt_temp_citext from '@abs_srcdir@/data/tt_citext.data'; +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_temp_citext) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from (select ('!@#%^&*' || v || '!@#%^&*') from tt_temp_citext) as t(v)) as t(v1, v2) where not (v1 = v2); v1 | v2 ----+---- (0 rows) @@ -939,4 +1324,19 @@ select * from (select try_convert(v, NULL::json) as v1, try_convert_by_sql(v, NU ----+---- (0 rows) +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 not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_text) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + +select * from (select try_convert(v, NULL::citext) as v1, try_convert_by_sql(v, NULL::citext) as v2 from tt_inet) as t(v1, v2) where not (v1 = v2); + v1 | v2 +----+---- +(0 rows) + reset search_path;