From d62fbaadfaaf7ee2568e8048c47b84ccb4c733a5 Mon Sep 17 00:00:00 2001 From: dengxuyue Date: Wed, 17 Mar 2021 20:58:51 +0800 Subject: [PATCH] Removed dual view --- src/common/backend/catalog/system_views.sql | 3 - src/test/regress/expected/hw_cursor_part3.out | 2 +- src/test/regress/expected/hw_datatype.out | 36 +-- src/test/regress/expected/hw_datatype_3.out | 4 +- .../regress/expected/hw_empty_str_to_null.out | 24 +- .../regress/expected/hw_func_return_out.out | 12 +- src/test/regress/expected/hw_function_p_4.out | 6 +- src/test/regress/expected/hw_groupingsets.out | 2 +- src/test/regress/expected/hw_to_timestamp.out | 274 +++++++++--------- src/test/regress/expected/interval.out | 4 +- src/test/regress/expected/llt_atc.out | 4 +- src/test/regress/expected/resolve_unknown.out | 8 +- src/test/regress/expected/xc_rownum.out | 4 +- src/test/regress/sql/hw_cursor_part3.sql | 2 +- src/test/regress/sql/hw_datatype.sql | 36 +-- src/test/regress/sql/hw_datatype_3.sql | 4 +- src/test/regress/sql/hw_empty_str_to_null.sql | 24 +- src/test/regress/sql/hw_func_return_out.sql | 12 +- src/test/regress/sql/hw_function_p_4.sql | 6 +- src/test/regress/sql/hw_groupingsets.sql | 2 +- src/test/regress/sql/hw_to_timestamp.sql | 274 +++++++++--------- src/test/regress/sql/interval.sql | 4 +- src/test/regress/sql/llt_atc.sql | 4 +- src/test/regress/sql/resolve_unknown.sql | 8 +- src/test/regress/sql/xc_rownum.sql | 4 +- 25 files changed, 380 insertions(+), 383 deletions(-) diff --git a/src/common/backend/catalog/system_views.sql b/src/common/backend/catalog/system_views.sql index 5dbf42470..c0afdf956 100644 --- a/src/common/backend/catalog/system_views.sql +++ b/src/common/backend/catalog/system_views.sql @@ -1850,9 +1850,6 @@ CREATE VIEW pg_user_mappings AS REVOKE ALL on pg_user_mapping FROM public; -CREATE OR REPLACE VIEW PG_CATALOG.DUAL AS (SELECT 'X'::TEXT AS DUMMY); -GRANT SELECT ON TABLE DUAL TO PUBLIC; - -- these functions are added for supporting default format transformation CREATE OR REPLACE FUNCTION to_char(NUMERIC) RETURNS VARCHAR2 diff --git a/src/test/regress/expected/hw_cursor_part3.out b/src/test/regress/expected/hw_cursor_part3.out index 6715d85a6..bf68ac390 100644 --- a/src/test/regress/expected/hw_cursor_part3.out +++ b/src/test/regress/expected/hw_cursor_part3.out @@ -230,7 +230,7 @@ b varchar; sql_srt varchar(100); cursor c1 is select c1,c2 from cursor_vl_tb10 order by 1,2; begin -sql_srt :='insert into cursor_vl_tb10(c1,c2) select :1,:1+1 from dual;'; +sql_srt :='insert into cursor_vl_tb10(c1,c2) select :1,:1+1;'; while a1 > 0 loop execute immediate sql_srt using IN a1; a1:=a1-1; diff --git a/src/test/regress/expected/hw_datatype.out b/src/test/regress/expected/hw_datatype.out index 21ee5f395..950f0aa0f 100644 --- a/src/test/regress/expected/hw_datatype.out +++ b/src/test/regress/expected/hw_datatype.out @@ -336,7 +336,7 @@ BEGIN raise info'TEST CHAR VALUE IS %',tempdata; END; $$ LANGUAGE plpgsql; -select TEST_FUNC('abc'::clob) from dual; +select TEST_FUNC('abc'::clob); INFO: TEST CHAR VALUE IS abc CONTEXT: referenced column: test_func test_func @@ -344,7 +344,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC('abc'::varchar2) from dual; +select TEST_FUNC('abc'::varchar2); INFO: TEST CHAR VALUE IS abc CONTEXT: referenced column: test_func test_func @@ -359,7 +359,7 @@ BEGIN raise info'TEST VARCHAR VALUE IS %',tempdata; END; $$ LANGUAGE plpgsql; -select TEST_FUNC('abc'::clob) from dual; +select TEST_FUNC('abc'::clob); INFO: TEST VARCHAR VALUE IS abc CONTEXT: referenced column: test_func test_func @@ -367,7 +367,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC(123) from dual; +select TEST_FUNC(123); INFO: TEST VARCHAR VALUE IS 123 CONTEXT: referenced column: test_func test_func @@ -375,7 +375,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC('123'::integer) from dual; +select TEST_FUNC('123'::integer); INFO: TEST VARCHAR VALUE IS 123 CONTEXT: referenced column: test_func test_func @@ -383,7 +383,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC('abc'::raw) from dual; +select TEST_FUNC('abc'::raw); INFO: TEST VARCHAR VALUE IS 0ABC CONTEXT: referenced column: test_func test_func @@ -391,7 +391,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC('abc'::char) from dual; +select TEST_FUNC('abc'::char); INFO: TEST VARCHAR VALUE IS a CONTEXT: referenced column: test_func test_func @@ -399,7 +399,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC('2012-08-01 11:23:45'::timestamp) from dual; --with timezone? +select TEST_FUNC('2012-08-01 11:23:45'::timestamp); --with timezone? INFO: TEST VARCHAR VALUE IS 2012-08-01 11:23:45 CONTEXT: referenced column: test_func test_func @@ -407,7 +407,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC(interval '1 18:00:00' day to second) from dual; +select TEST_FUNC(interval '1 18:00:00' day to second); INFO: TEST VARCHAR VALUE IS @ 1 day 18 hours CONTEXT: referenced column: test_func test_func @@ -415,7 +415,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC('1 day 18:00:00') from dual; +select TEST_FUNC('1 day 18:00:00'); INFO: TEST VARCHAR VALUE IS 1 day 18:00:00 CONTEXT: referenced column: test_func test_func @@ -430,7 +430,7 @@ BEGIN raise info'TEST CLOB VALUE IS %',tempdata; END; $$ LANGUAGE plpgsql; -select TEST_FUNC('abc'::char) from dual; +select TEST_FUNC('abc'::char); INFO: TEST CLOB VALUE IS a CONTEXT: referenced column: test_func test_func @@ -438,7 +438,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC('abc'::varchar2) from dual; +select TEST_FUNC('abc'::varchar2); INFO: TEST CLOB VALUE IS abc CONTEXT: referenced column: test_func test_func @@ -453,7 +453,7 @@ BEGIN raise info'TEST INTEGER VALUE IS %',tempdata; END; $$ LANGUAGE plpgsql; -select TEST_FUNC('123'::char(3)) from dual; +select TEST_FUNC('123'::char(3)); INFO: TEST INTEGER VALUE IS 123 CONTEXT: referenced column: test_func test_func @@ -461,7 +461,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC('123'::varchar2) from dual; +select TEST_FUNC('123'::varchar2); INFO: TEST INTEGER VALUE IS 123 CONTEXT: referenced column: test_func test_func @@ -476,7 +476,7 @@ BEGIN raise info'TEST TIMESTAMP VALUE IS %',tempdata; END; $$ LANGUAGE plpgsql; -select TEST_FUNC('2012-08-01 11:23:45'::char(20)) from dual; +select TEST_FUNC('2012-08-01 11:23:45'::char(20)); INFO: TEST TIMESTAMP VALUE IS 2012-08-01 11:23:45 CONTEXT: referenced column: test_func test_func @@ -484,7 +484,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC('2012-08-01 11:23:45'::varchar2) from dual; +select TEST_FUNC('2012-08-01 11:23:45'::varchar2); INFO: TEST TIMESTAMP VALUE IS 2012-08-01 11:23:45 CONTEXT: referenced column: test_func test_func @@ -499,7 +499,7 @@ BEGIN raise info'TEST INTERVAL VALUE IS %',tempdata; END; $$ LANGUAGE plpgsql; -select TEST_FUNC('1 day 18:00:00'::char(20)) from dual; +select TEST_FUNC('1 day 18:00:00'::char(20)); INFO: TEST INTERVAL VALUE IS @ 1 day 18 hours CONTEXT: referenced column: test_func test_func @@ -507,7 +507,7 @@ CONTEXT: referenced column: test_func (1 row) -select TEST_FUNC('1 day 18:00:00'::varchar2) from dual; +select TEST_FUNC('1 day 18:00:00'::varchar2); INFO: TEST INTERVAL VALUE IS @ 1 day 18 hours CONTEXT: referenced column: test_func test_func diff --git a/src/test/regress/expected/hw_datatype_3.out b/src/test/regress/expected/hw_datatype_3.out index fc0082678..69ae4c774 100644 --- a/src/test/regress/expected/hw_datatype_3.out +++ b/src/test/regress/expected/hw_datatype_3.out @@ -853,7 +853,7 @@ HINT: Perhaps you need a different "datestyle" setting. drop table date_smalldate; --INTERAL TO NUMERIC create table test_num(mynum numeric); -select to_date('2013-03-14 14:27:00','YYYY-MM-DD HH24:MI:SS') - to_date('2013-3-1 9:00:00','YYYY-MM-DD HH24:MI:SS') from dual; +select to_date('2013-03-14 14:27:00','YYYY-MM-DD HH24:MI:SS') - to_date('2013-3-1 9:00:00','YYYY-MM-DD HH24:MI:SS'); ?column? --------------------------- @ 13 days 5 hours 27 mins @@ -882,7 +882,7 @@ select floor(mynum) from test_num order by 1; (2 rows) drop table test_num; -select floor(interval '2 days 09:33:00') from dual; +select floor(interval '2 days 09:33:00'); floor ------- 2 diff --git a/src/test/regress/expected/hw_empty_str_to_null.out b/src/test/regress/expected/hw_empty_str_to_null.out index 92c113aa2..880e6c77f 100644 --- a/src/test/regress/expected/hw_empty_str_to_null.out +++ b/src/test/regress/expected/hw_empty_str_to_null.out @@ -28,8 +28,8 @@ select * from test_tb where name is null; (1 row) drop table test_tb; --- select * from ( select 'NULL' from dual); -select * from ( select 'NULL' from dual) as a; +-- select * from ( select 'NULL'); +select * from ( select 'NULL') as a; ?column? ---------- NULL @@ -89,49 +89,49 @@ select ltrim('abc', 'a') is not null; /* The following case depence on nvl which is added by GuassDB */ /* expect is null */ -select nvl(ltrim(NULL), 'is null') from dual; +select nvl(ltrim(NULL), 'is null'); nvl --------- is null (1 row) -select nvl(ltrim(''), 'is null') from dual; +select nvl(ltrim(''), 'is null'); nvl --------- is null (1 row) -select nvl(ltrim('', 'ab'), 'is null') from dual; +select nvl(ltrim('', 'ab'), 'is null'); nvl --------- is null (1 row) -select nvl(ltrim(NULL, 'ab'), 'is null') from dual; +select nvl(ltrim(NULL, 'ab'), 'is null'); nvl --------- is null (1 row) -select nvl(ltrim('ab', ''), 'is null') from dual; +select nvl(ltrim('ab', ''), 'is null'); nvl --------- is null (1 row) -select nvl(ltrim('ab', NULL), 'is null') from dual; +select nvl(ltrim('ab', NULL), 'is null'); nvl --------- is null (1 row) -select nvl(ltrim('ab', 'ab'), 'is null') from dual; +select nvl(ltrim('ab', 'ab'), 'is null'); nvl --------- is null (1 row) -select nvl(ltrim('abc', 'a'), 'is not null') from dual; -- return bc +select nvl(ltrim('abc', 'a'), 'is not null'); -- return bc nvl ----- bc @@ -445,13 +445,13 @@ select * from test_table where regexp_like(name, NULL, 'i'); -- return null (0 rows) drop table test_table; -select nvl(regexp_substr('This is test',''), 'This is NULL') from dual; -- return This is NULL +select nvl(regexp_substr('This is test',''), 'This is NULL'); -- return This is NULL nvl -------------- This is NULL (1 row) -select nvl(regexp_substr('This is test',NULL), 'This is NULL') from dual; -- return This is NULL +select nvl(regexp_substr('This is test',NULL), 'This is NULL'); -- return This is NULL nvl -------------- This is NULL diff --git a/src/test/regress/expected/hw_func_return_out.out b/src/test/regress/expected/hw_func_return_out.out index 695cd33c6..348eccec1 100644 --- a/src/test/regress/expected/hw_func_return_out.out +++ b/src/test/regress/expected/hw_func_return_out.out @@ -9,7 +9,7 @@ AS RETURN; END; / -SELECT test_return(1) from dual; +SELECT test_return(1); test_return ------------- 2 @@ -48,7 +48,7 @@ AS RETURN j; END; / -SELECT test_return1(1) from dual; +SELECT test_return1(1); test_return1 -------------- 2 @@ -123,7 +123,7 @@ AS RETURN 'abc'; END; / -SELECT test_return5(1) from dual; +SELECT test_return5(1); test_return5 -------------- abc @@ -610,7 +610,7 @@ AS RETURN; END; / -SELECT test_return(1) from dual; +SELECT test_return(1); test_return ------------- 2 @@ -649,7 +649,7 @@ AS RETURN j; END; / -SELECT test_return1(1) from dual; +SELECT test_return1(1); test_return1 -------------- 2 @@ -724,7 +724,7 @@ AS RETURN 'abc'; END; / -SELECT test_return5(1) from dual; +SELECT test_return5(1); test_return5 -------------- abc diff --git a/src/test/regress/expected/hw_function_p_4.out b/src/test/regress/expected/hw_function_p_4.out index 87383a315..43c1ff635 100644 --- a/src/test/regress/expected/hw_function_p_4.out +++ b/src/test/regress/expected/hw_function_p_4.out @@ -71,7 +71,7 @@ returns integer language plpgsql as $$ declare begin -create temp table test_create_tmp as (select sysdate as s from dual); +create temp table test_create_tmp as (select sysdate as s); ret :=0; end $$ ; @@ -174,12 +174,12 @@ returns integer language plpgsql as $$ declare begin -create temp table test_create_tmp as (select sysdate as s from dual); +create temp table test_create_tmp as (select sysdate as s); ret :=0; insert into test_create_tmp_no_exit values (2); exception when others then -create temp table test_create_tmp as (select sysdate as s from dual); +create temp table test_create_tmp as (select sysdate as s); ret :=1; end $$ ; diff --git a/src/test/regress/expected/hw_groupingsets.out b/src/test/regress/expected/hw_groupingsets.out index 1ccbff769..a94971951 100644 --- a/src/test/regress/expected/hw_groupingsets.out +++ b/src/test/regress/expected/hw_groupingsets.out @@ -2671,7 +2671,7 @@ explain (format JSON) select a, b, c from vec_t1 group by rollup(a, b, c); explain (format YAML) select a, b, c from vec_t1 group by rollup(a, b, c); \o drop table vec_t1; -select 1 a,2,count(*) from dual group by cube(1,2) having count(*)=1 order by 1, 2; +select 1 a,2,count(*) group by cube(1,2) having count(*)=1 order by 1, 2; a | ?column? | count ---+----------+------- 1 | 2 | 1 diff --git a/src/test/regress/expected/hw_to_timestamp.out b/src/test/regress/expected/hw_to_timestamp.out index ae07fddb6..d40523b6a 100644 --- a/src/test/regress/expected/hw_to_timestamp.out +++ b/src/test/regress/expected/hw_to_timestamp.out @@ -149,482 +149,482 @@ CONTEXT: referenced column: to_timestamp SELECT TO_TIMESTAMP('366-4','YYYY-DD-12'); ERROR: invalid data for match in format string CONTEXT: referenced column: to_timestamp -select to_timestamp('-4713','YYYY') from dual; +select to_timestamp('-4713','YYYY'); ERROR: invalid data for "year = -4713" ,value must be between 1 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4712','YYYY') from dual; +select to_timestamp('-4712','YYYY'); ERROR: invalid data for "year = -4712" ,value must be between 1 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('-1','YYYY') from dual; +select to_timestamp('-1','YYYY'); ERROR: invalid data for "year = -1" ,value must be between 1 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('0','YYYY') from dual; +select to_timestamp('0','YYYY'); ERROR: invalid data for "year = 0" ,value must be between 1 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('1','YYYY') from dual; +select to_timestamp('1','YYYY'); to_timestamp --------------------- 0001-01-01 00:00:00 (1 row) -select to_timestamp('9999','YYYY') from dual; +select to_timestamp('9999','YYYY'); to_timestamp --------------------- 9999-01-01 00:00:00 (1 row) -select to_timestamp('10000','YYYY') from dual; +select to_timestamp('10000','YYYY'); ERROR: invalid data for "year = 10000" ,value must be between 1 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('10','H24') from dual; +select to_timestamp('10','H24'); ERROR: invalid data for match in format string CONTEXT: referenced column: to_timestamp -select to_timestamp('10','H24') from dual; +select to_timestamp('10','H24'); ERROR: invalid data for match in format string CONTEXT: referenced column: to_timestamp -SELECT to_timestamp('-2012-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF') FROM DUAL; +SELECT to_timestamp('-2012-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF'); ERROR: invalid data for "year = -2012" ,value must be between 1 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -SELECT to_timestamp('-1-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF') FROM DUAL; +SELECT to_timestamp('-1-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF'); ERROR: invalid data for "year = -1" ,value must be between 1 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -SELECT to_timestamp('0-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF') FROM DUAL; +SELECT to_timestamp('0-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF'); ERROR: invalid data for "year = 0" ,value must be between 1 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -SELECT to_timestamp('9999-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF') FROM DUAL; +SELECT to_timestamp('9999-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF'); to_timestamp ------------------------ 9999-02-03 21:15:36.18 (1 row) -SELECT to_timestamp('10000-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF') FROM DUAL; +SELECT to_timestamp('10000-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF'); ERROR: invalid data for "year = 10000" ,value must be between 1 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4713-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year = -4713" ,value must be between -4712 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4712-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4712-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff'); to_timestamp ------------------------------- 4712-03-04 13:02:03.234015 BC (1 row) -select to_timestamp('0-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('0-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year = 0" ,value must be between -4712 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('9999-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('9999-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 9999-03-04 13:02:03.234015 (1 row) -select to_timestamp('10000-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('10000-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year = 10000" ,value must be between -4712 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4713-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year = -4713" ,value must be between -4712 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4712-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4712-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff'); to_timestamp ------------------------------- 4712-03-04 13:02:03.234015 BC (1 row) -select to_timestamp('0-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('0-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year = 0" ,value must be between -4712 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('9999-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('9999-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 9999-03-04 13:02:03.234015 (1 row) -select to_timestamp('10000-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('10000-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year = 10000" ,value must be between -4712 and 9999, and not be 0 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4713-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = -4713" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4712-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4712-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = -4712" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('-1-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-1-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); ERROR: RR/RRRR should be between 0 - 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('0-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('0-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 2000-03-04 13:02:03.234015 (1 row) -select to_timestamp('1-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('1-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 2001-03-04 13:02:03.234015 (1 row) -select to_timestamp('9999-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('9999-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 9999-03-04 13:02:03.234015 (1 row) -select to_timestamp('10000-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('10000-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = 10000" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4713-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = -4713" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4712-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4712-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = -4712" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('-1-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-1-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); ERROR: RR/RRRR should be between 0 - 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('0-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('0-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 2000-03-04 13:02:03.234015 (1 row) -select to_timestamp('1-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('1-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 2001-03-04 13:02:03.234015 (1 row) -select to_timestamp('9999-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('9999-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 9999-03-04 13:02:03.234015 (1 row) -select to_timestamp('10000-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('10000-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = 10000" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4713-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = -4713" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4712-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4712-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = -4712" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('-1-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-1-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); ERROR: RR/RRRR should be between 0 - 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('0-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('0-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 2000-03-04 13:02:03.234015 (1 row) -select to_timestamp('1-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('1-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 2001-03-04 13:02:03.234015 (1 row) -select to_timestamp('9999-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('9999-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 9999-03-04 13:02:03.234015 (1 row) -select to_timestamp('10000-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('10000-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = 10000" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4713-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = -4713" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('-4712-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4712-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = -4712" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('-1-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-1-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); ERROR: RR/RRRR should be between 0 - 9999 CONTEXT: referenced column: to_timestamp -select to_timestamp('0-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('0-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 2000-03-04 13:02:03.234015 (1 row) -select to_timestamp('1-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('1-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 2001-03-04 13:02:03.234015 (1 row) -select to_timestamp('9999-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('9999-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); to_timestamp ---------------------------- 9999-03-04 13:02:03.234015 (1 row) -select to_timestamp('10000-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('10000-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); ERROR: invalid data for "year(RR/RRRR) = 10000" ,value must be between 0 and 9999 CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('0000-09-01','YYYYY-MM-DD') FROM DUAL; +SELECT TO_TIMESTAMP('0000-09-01','YYYYY-MM-DD'); ERROR: conflicting values for "Y" field in formatting string DETAIL: This value contradicts a previous setting for the same field type. CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('0000-09-01','SYYYYY-MM-DD') FROM DUAL; +SELECT TO_TIMESTAMP('0000-09-01','SYYYYY-MM-DD'); ERROR: invalid value "0000-" for "SYYYY" DETAIL: Field requires 5 characters, but only 4 could be parsed. HINT: If your source string is not fixed-width, try using the "FM" modifier. CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('0000-09-01','SYYYY-Y-MM-DD') FROM DUAL; +SELECT TO_TIMESTAMP('0000-09-01','SYYYY-Y-MM-DD'); ERROR: conflicting values for "Y" field in formatting string DETAIL: This value contradicts a previous setting for the same field type. CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('25361','SSSSS') FROM DUAL; +SELECT TO_TIMESTAMP('25361','SSSSS'); to_timestamp ------------------------ 0001-01-01 07:02:41 BC (1 row) -SELECT TO_TIMESTAMP('25361-2','SSSSS-HH12') FROM DUAL; +SELECT TO_TIMESTAMP('25361-2','SSSSS-HH12'); ERROR: hour conflicts with seconds in day CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('25361-07','SSSSS-HH12') FROM DUAL; +SELECT TO_TIMESTAMP('25361-07','SSSSS-HH12'); to_timestamp ------------------------ 0001-01-01 07:02:41 BC (1 row) -SELECT TO_TIMESTAMP('25361-2','SSSSS-MI') FROM DUAL; +SELECT TO_TIMESTAMP('25361-2','SSSSS-MI'); to_timestamp ------------------------ 0001-01-01 07:02:41 BC (1 row) -SELECT TO_TIMESTAMP('25361-10','SSSSS-MI') FROM DUAL; +SELECT TO_TIMESTAMP('25361-10','SSSSS-MI'); ERROR: minutes of hour conflicts with seconds in day CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('25361-2','SSSSS-SS') FROM DUAL; +SELECT TO_TIMESTAMP('25361-2','SSSSS-SS'); ERROR: seconds of minute conflicts with seconds in day CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('25361-41','SSSSS-SS') FROM DUAL; +SELECT TO_TIMESTAMP('25361-41','SSSSS-SS'); to_timestamp ------------------------ 0001-01-01 07:02:41 BC (1 row) -SELECT TO_TIMESTAMP('2650000','J') FROM DUAL; +SELECT TO_TIMESTAMP('2650000','J'); to_timestamp --------------------- 2543-05-09 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2650000-2542','J-YYYY') FROM DUAL; +SELECT TO_TIMESTAMP('2650000-2542','J-YYYY'); ERROR: year conflicts with Julian date CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('2650000-2543','J-YYYY') FROM DUAL; +SELECT TO_TIMESTAMP('2650000-2543','J-YYYY'); to_timestamp --------------------- 2543-05-09 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2650000-4','J-MM') FROM DUAL; +SELECT TO_TIMESTAMP('2650000-4','J-MM'); ERROR: month conflicts with Julian date CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('2650000-5','J-MM') FROM DUAL; +SELECT TO_TIMESTAMP('2650000-5','J-MM'); to_timestamp --------------------- 2543-05-09 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2650000-8','J-DD') FROM DUAL; +SELECT TO_TIMESTAMP('2650000-8','J-DD'); ERROR: day conflicts with Julian date CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('2650000-9','J-DD') FROM DUAL; +SELECT TO_TIMESTAMP('2650000-9','J-DD'); to_timestamp --------------------- 2543-05-09 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2012-245','YYYY-DDD') FROM DUAL; +SELECT TO_TIMESTAMP('2012-245','YYYY-DDD'); to_timestamp --------------------- 2012-09-01 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2012-245-8','YYYY-DDD-MM') FROM DUAL; +SELECT TO_TIMESTAMP('2012-245-8','YYYY-DDD-MM'); ERROR: month conflicts with days of year CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('2012-245-9','YYYY-DDD-MM') FROM DUAL; +SELECT TO_TIMESTAMP('2012-245-9','YYYY-DDD-MM'); to_timestamp --------------------- 2012-09-01 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2012-245-1','YYYY-DDD-DD') FROM DUAL; +SELECT TO_TIMESTAMP('2012-245-1','YYYY-DDD-DD'); to_timestamp --------------------- 2012-09-01 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2012-245-2','YYYY-DDD-DD') FROM DUAL; +SELECT TO_TIMESTAMP('2012-245-2','YYYY-DDD-DD'); ERROR: days of month conflicts with days of year CONTEXT: referenced column: to_timestamp --MS -SELECT TO_TIMESTAMP('-1','MS') FROM DUAL; +SELECT TO_TIMESTAMP('-1','MS'); ERROR: invalid data for "millisecond = -10" ,value must be between 0 and 999 CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('0','MS') FROM DUAL; +SELECT TO_TIMESTAMP('0','MS'); to_timestamp ------------------------ 0001-01-01 00:00:00 BC (1 row) -SELECT TO_TIMESTAMP('256','MS') FROM DUAL; +SELECT TO_TIMESTAMP('256','MS'); to_timestamp ---------------------------- 0001-01-01 00:00:00.256 BC (1 row) -SELECT TO_TIMESTAMP('999','MS') FROM DUAL; +SELECT TO_TIMESTAMP('999','MS'); to_timestamp ---------------------------- 0001-01-01 00:00:00.999 BC (1 row) -SELECT TO_TIMESTAMP('1000','MS') FROM DUAL; +SELECT TO_TIMESTAMP('1000','MS'); ERROR: invalid data for "millisecond = 1000" ,value must be between 0 and 999 CONTEXT: referenced column: to_timestamp --WW -SELECT TO_TIMESTAMP('0','WW') FROM DUAL; +SELECT TO_TIMESTAMP('0','WW'); ERROR: invalid data for "week number of year = 0" ,value must be between 1 and 53 CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('1','WW') FROM DUAL; +SELECT TO_TIMESTAMP('1','WW'); ERROR: cannot calculate day of year without year information CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('10','WW') FROM DUAL; +SELECT TO_TIMESTAMP('10','WW'); ERROR: cannot calculate day of year without year information CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('53','WW') FROM DUAL; +SELECT TO_TIMESTAMP('53','WW'); ERROR: cannot calculate day of year without year information CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('54','WW') FROM DUAL; +SELECT TO_TIMESTAMP('54','WW'); ERROR: invalid data for "week number of year = 54" ,value must be between 1 and 53 CONTEXT: referenced column: to_timestamp --D -SELECT TO_TIMESTAMP('0','D') FROM DUAL; +SELECT TO_TIMESTAMP('0','D'); ERROR: invalid data for "day = 0" ,value must be between 1 and 7 CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('1','D') FROM DUAL; +SELECT TO_TIMESTAMP('1','D'); to_timestamp ------------------------ 0001-01-01 00:00:00 BC (1 row) -SELECT TO_TIMESTAMP('4','D') FROM DUAL; +SELECT TO_TIMESTAMP('4','D'); to_timestamp ------------------------ 0001-01-01 00:00:00 BC (1 row) -SELECT TO_TIMESTAMP('7','D') FROM DUAL; +SELECT TO_TIMESTAMP('7','D'); to_timestamp ------------------------ 0001-01-01 00:00:00 BC (1 row) -SELECT TO_TIMESTAMP('8','D') FROM DUAL; +SELECT TO_TIMESTAMP('8','D'); ERROR: invalid data for "day = 8" ,value must be between 1 and 7 CONTEXT: referenced column: to_timestamp --WW & D YYYY -SELECT TO_TIMESTAMP('2012-50-0','YYYY-WW-D') FROM DUAL; +SELECT TO_TIMESTAMP('2012-50-0','YYYY-WW-D'); ERROR: invalid data for "day = 0" ,value must be between 1 and 7 CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('2012-50-1','YYYY-WW-D') FROM DUAL; +SELECT TO_TIMESTAMP('2012-50-1','YYYY-WW-D'); to_timestamp --------------------- 2012-12-09 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2012-50-4','YYYY-WW-D') FROM DUAL; +SELECT TO_TIMESTAMP('2012-50-4','YYYY-WW-D'); to_timestamp --------------------- 2012-12-09 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2012-50-7','YYYY-WW-D') FROM DUAL; +SELECT TO_TIMESTAMP('2012-50-7','YYYY-WW-D'); to_timestamp --------------------- 2012-12-09 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2012-50-8','YYYY-WW-D') FROM DUAL; +SELECT TO_TIMESTAMP('2012-50-8','YYYY-WW-D'); ERROR: invalid data for "day = 8" ,value must be between 1 and 7 CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('2012-0-4','YYYY-WW-D') FROM DUAL; +SELECT TO_TIMESTAMP('2012-0-4','YYYY-WW-D'); ERROR: invalid data for "week number of year = 0" ,value must be between 1 and 53 CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('2012-1-4','YYYY-WW-D') FROM DUAL; +SELECT TO_TIMESTAMP('2012-1-4','YYYY-WW-D'); to_timestamp --------------------- 2012-01-01 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2012-50-4','YYYY-WW-D') FROM DUAL; +SELECT TO_TIMESTAMP('2012-50-4','YYYY-WW-D'); to_timestamp --------------------- 2012-12-09 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2012-53-4','YYYY-WW-D') FROM DUAL; +SELECT TO_TIMESTAMP('2012-53-4','YYYY-WW-D'); to_timestamp --------------------- 2012-12-30 00:00:00 (1 row) -SELECT TO_TIMESTAMP('2012-54-4','YYYY-WW-D') FROM DUAL; +SELECT TO_TIMESTAMP('2012-54-4','YYYY-WW-D'); ERROR: invalid data for "week number of year = 54" ,value must be between 1 and 53 CONTEXT: referenced column: to_timestamp --US -SELECT TO_TIMESTAMP('-1','US') FROM DUAL; +SELECT TO_TIMESTAMP('-1','US'); ERROR: invalid data for "microsecond = -10000" ,value must be between 1 and 999999 CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('0','US') FROM DUAL; +SELECT TO_TIMESTAMP('0','US'); to_timestamp ------------------------ 0001-01-01 00:00:00 BC (1 row) -SELECT TO_TIMESTAMP('99999','US') FROM DUAL; +SELECT TO_TIMESTAMP('99999','US'); to_timestamp ------------------------------ 0001-01-01 00:00:00.99999 BC (1 row) -SELECT TO_TIMESTAMP('999999','US') FROM DUAL; +SELECT TO_TIMESTAMP('999999','US'); to_timestamp ------------------------------- 0001-01-01 00:00:00.999999 BC (1 row) -SELECT TO_TIMESTAMP('1000000','US') FROM DUAL; +SELECT TO_TIMESTAMP('1000000','US'); ERROR: input length of format 'US'/'us'/'FF'/'ff' must between 0 and 6 CONTEXT: referenced column: to_timestamp --W -SELECT TO_TIMESTAMP('-1','W') FROM DUAL; +SELECT TO_TIMESTAMP('-1','W'); ERROR: invalid data for "week of month = -1" ,value must be between 1 and 5 CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('0','W') FROM DUAL; +SELECT TO_TIMESTAMP('0','W'); ERROR: invalid data for "week of month = 0" ,value must be between 1 and 5 CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('1','W') FROM DUAL; +SELECT TO_TIMESTAMP('1','W'); to_timestamp ------------------------ 0001-01-01 00:00:00 BC (1 row) -SELECT TO_TIMESTAMP('5','W') FROM DUAL; +SELECT TO_TIMESTAMP('5','W'); to_timestamp ------------------------ 0001-01-29 00:00:00 BC (1 row) -SELECT TO_TIMESTAMP('6','W') FROM DUAL; +SELECT TO_TIMESTAMP('6','W'); ERROR: invalid data for "week of month = 6" ,value must be between 1 and 5 CONTEXT: referenced column: to_timestamp SHOW nls_timestamp_format; @@ -633,55 +633,55 @@ SHOW nls_timestamp_format; DD-Mon-YYYY HH:MI:SS.FF AM (1 row) -SELECT TO_TIMESTAMP('01') FROM DUAL; +SELECT TO_TIMESTAMP('01'); to_timestamp ------------------------ 0001-01-01 00:00:00 BC (1 row) -SELECT TO_TIMESTAMP('01-Sep') FROM DUAL; +SELECT TO_TIMESTAMP('01-Sep'); to_timestamp ------------------------ 0001-09-01 00:00:00 BC (1 row) -SELECT TO_TIMESTAMP('01-Sep-1998') FROM DUAL; +SELECT TO_TIMESTAMP('01-Sep-1998'); to_timestamp --------------------- 1998-09-01 00:00:00 (1 row) -SELECT TO_TIMESTAMP('01-Sep-1998 11') FROM DUAL; +SELECT TO_TIMESTAMP('01-Sep-1998 11'); to_timestamp --------------------- 1998-09-01 11:00:00 (1 row) -SELECT TO_TIMESTAMP('01-Sep-1998 11:12') FROM DUAL; +SELECT TO_TIMESTAMP('01-Sep-1998 11:12'); to_timestamp --------------------- 1998-09-01 11:12:00 (1 row) -SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13') FROM DUAL; +SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13'); to_timestamp --------------------- 1998-09-01 11:12:13 (1 row) -SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13.12') FROM DUAL; +SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13.12'); to_timestamp ------------------------ 1998-09-01 11:12:13.12 (1 row) -SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13.12 PM') FROM DUAL; +SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13.12 PM'); to_timestamp ------------------------ 1998-09-01 23:12:13.12 (1 row) -SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13 PM') FROM DUAL; +SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13 PM'); ERROR: invalid value "PM" for "FF" DETAIL: Value must be an integer. CONTEXT: referenced column: to_timestamp @@ -692,65 +692,65 @@ SHOW nls_timestamp_format; YYYY-MM-DD HH:MI:SS.FF AM (1 row) -SELECT TO_TIMESTAMP('1998') FROM DUAL; +SELECT TO_TIMESTAMP('1998'); to_timestamp --------------------- 1998-01-01 00:00:00 (1 row) -SELECT TO_TIMESTAMP('1998-12-28') FROM DUAL; +SELECT TO_TIMESTAMP('1998-12-28'); to_timestamp --------------------- 1998-12-28 00:00:00 (1 row) -SELECT TO_TIMESTAMP('1998-12-28 01') FROM DUAL; +SELECT TO_TIMESTAMP('1998-12-28 01'); to_timestamp --------------------- 1998-12-28 01:00:00 (1 row) -SELECT TO_TIMESTAMP('1998-12-28 01:02') FROM DUAL; +SELECT TO_TIMESTAMP('1998-12-28 01:02'); to_timestamp --------------------- 1998-12-28 01:02:00 (1 row) -SELECT TO_TIMESTAMP('1998-12-28 01:02:03') FROM DUAL; +SELECT TO_TIMESTAMP('1998-12-28 01:02:03'); to_timestamp --------------------- 1998-12-28 01:02:03 (1 row) -SELECT TO_TIMESTAMP('1998-12-28 01:02:03.12') FROM DUAL; +SELECT TO_TIMESTAMP('1998-12-28 01:02:03.12'); to_timestamp ------------------------ 1998-12-28 01:02:03.12 (1 row) -SELECT TO_TIMESTAMP('1998-12-28 01:02:03.12 AM') FROM DUAL; +SELECT TO_TIMESTAMP('1998-12-28 01:02:03.12 AM'); to_timestamp ------------------------ 1998-12-28 01:02:03.12 (1 row) -SELECT TO_TIMESTAMP('1998-12-28 11:12:13 PM') FROM DUAL; +SELECT TO_TIMESTAMP('1998-12-28 11:12:13 PM'); ERROR: invalid value "PM" for "FF" DETAIL: Value must be an integer. CONTEXT: referenced column: to_timestamp -SELECT TO_TIMESTAMP('01') FROM DUAL; +SELECT TO_TIMESTAMP('01'); to_timestamp --------------------- 0001-01-01 00:00:00 (1 row) -select to_date('2018--12;30', 'yyyy//mm/,,dd') from dual; +select to_date('2018--12;30', 'yyyy//mm/,,dd'); to_date --------------------- 2018-12-30 00:00:00 (1 row) -select to_date('2018-12 30', 'yyyy//mm/dd') from dual; +select to_date('2018-12 30', 'yyyy//mm/dd'); to_date --------------------- 2018-12-30 00:00:00 @@ -762,20 +762,20 @@ select to_date('20181231124559','yyyy-MM-dd hh24:mi:ss'); 2018-12-31 12:45:59 (1 row) -SELECT (TO_DATE('1999(12*23 12 26','yyyy-MM-dd hh24:mi:ss')) FROM dual; +SELECT (TO_DATE('1999(12*23 12 26','yyyy-MM-dd hh24:mi:ss')); to_date --------------------- 1999-12-23 12:26:00 (1 row) -SELECT (TO_DATE('1999(12*23 12 26','yyyy-MM-dd hh24:mi:ss')) FROM dual; +SELECT (TO_DATE('1999(12*23 12 26','yyyy-MM-dd hh24:mi:ss')); to_date --------------------- 1999-12-23 12:26:00 (1 row) SELECT (TO_DATE('1999(12*23 12 -26','yyyy-MM-dd hh24:mi:ss')) FROM dual; +26','yyyy-MM-dd hh24:mi:ss')); to_date --------------------- 1999-12-23 12:26:00 @@ -787,31 +787,31 @@ SELECT to_date('10', 'SSSSS'); 0001-01-01 00:00:10 BC (1 row) -SELECT TO_TIMESTAMP('01', 'yyyy-MM-dd') FROM DUAL; +SELECT TO_TIMESTAMP('01', 'yyyy-MM-dd'); to_timestamp --------------------- 0001-01-01 00:00:00 (1 row) -SELECT TO_CHAR(TO_DATE('27OCT17', 'DDMONRR') ,'YYYY') "Year" FROM DUAL; +SELECT TO_CHAR(TO_DATE('27OCT17', 'DDMONRR') ,'YYYY') "Year"; Year ------ 2017 (1 row) -SELECT TO_CHAR(TO_DATE('27-OCT98', 'DD-MON-RR') ,'YYYY') "Year" FROM DUAL; +SELECT TO_CHAR(TO_DATE('27-OCT98', 'DD-MON-RR') ,'YYYY') "Year"; Year ------ 1998 (1 row) -SELECT TO_CHAR(TO_DATE('27DEC98', 'DDMON-RR') ,'MON') "Month" FROM DUAL; +SELECT TO_CHAR(TO_DATE('27DEC98', 'DDMON-RR') ,'MON') "Month"; Month ------- DEC (1 row) -SELECT TO_CHAR(TO_DATE('27/OCT/17', 'DD-MON-RR') ,'DD') "Year" FROM DUAL; +SELECT TO_CHAR(TO_DATE('27/OCT/17', 'DD-MON-RR') ,'DD') "Year"; Year ------ 27 diff --git a/src/test/regress/expected/interval.out b/src/test/regress/expected/interval.out index 59e435966..3415a386d 100644 --- a/src/test/regress/expected/interval.out +++ b/src/test/regress/expected/interval.out @@ -53,7 +53,7 @@ SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years..."; (1 row) --check interval concat null -SELECT '' || INTERVAL '10 years -11 month -12 days +13:14' AS "9 years..." from dual; +SELECT '' || INTERVAL '10 years -11 month -12 days +13:14' AS "9 years..."; 9 years... ---------------------------------- 9 years 1 mon -12 days +13:14:00 @@ -715,7 +715,7 @@ SELECT interval '1 2:03:04.5678' minute to second(2); (1 row) --check interval concat with null -SELECT interval '1 2:03:04.5678' minute to second(2) || '' from dual; +SELECT interval '1 2:03:04.5678' minute to second(2) || ''; ?column? ------------------- 1 day 02:03:04.57 diff --git a/src/test/regress/expected/llt_atc.out b/src/test/regress/expected/llt_atc.out index 61104f012..a34869e3c 100644 --- a/src/test/regress/expected/llt_atc.out +++ b/src/test/regress/expected/llt_atc.out @@ -1,11 +1,11 @@ -- add test case into 'case DCH_RRRR' and 'case DCH_RR' in DCH_from_char function, then the function adjust_partial_year_to_current_year will covered: -select to_date('06-JAN-40 00:00:00','DD-MON-RRRR HH24:MI:SS') from dual; +select to_date('06-JAN-40 00:00:00','DD-MON-RRRR HH24:MI:SS'); to_date -------------------------- Fri Jan 06 00:00:00 2040 (1 row) -select to_date('01/05/81','dd/mm/rr') from dual; +select to_date('01/05/81','dd/mm/rr'); to_date -------------------------- Fri May 01 00:00:00 1981 diff --git a/src/test/regress/expected/resolve_unknown.out b/src/test/regress/expected/resolve_unknown.out index cd1ee0d36..44c6fe6ae 100644 --- a/src/test/regress/expected/resolve_unknown.out +++ b/src/test/regress/expected/resolve_unknown.out @@ -33,7 +33,7 @@ explain (verbose on, costs off) select 1 where 'vasya' = (select 'vasya' as col1 Output: 'vasya'::text (6 rows) -explain (verbose on, costs off) select 1 where 'vasya' = (select 'vasya' as col1 from dual where col1 <> 'aaa'); +explain (verbose on, costs off) select 1 where 'vasya' = (select 'vasya' as col1 where col1 <> 'aaa'); QUERY PLAN ----------------------------------------- Result @@ -58,7 +58,7 @@ select 1 where 'vasya' = (select 'vasya' as col1 where col1 <> 'aaa'); 1 (1 row) -select 1 where 'vasya' = (select 'vasya' as col1 from dual where col1 <> 'aaa'); +select 1 where 'vasya' = (select 'vasya' as col1 where col1 <> 'aaa'); ?column? ---------- 1 @@ -239,7 +239,7 @@ INSERT INTO test_unknown(a, b) VALUES (4, 'suzhou'), (5, 'hangzhou') ORDER BY 1 ERROR: column "b" is of type unknown but expression is of type text HINT: You will need to rewrite or cast the expression. CONTEXT: referenced column: b -INSERT INTO test_unknown(a, b) SELECT 6, 'xian' FROM DUAL; +INSERT INTO test_unknown(a, b) SELECT 6, 'xian'; TABLE test_unknown ORDER BY a; a | b | c ---+----------+--- @@ -260,7 +260,7 @@ INSERT INTO test_unknown(a, b) VALUES (4, 'suzhou'), (5, 'hangzhou') ORDER BY 1 ERROR: column "b" is of type unknown but expression is of type text HINT: You will need to rewrite or cast the expression. CONTEXT: referenced column: b -INSERT INTO test_unknown(a, b) SELECT 6, 'xian' FROM DUAL; +INSERT INTO test_unknown(a, b) SELECT 6, 'xian'; TABLE test_unknown ORDER BY a; a | b | c ---+----------+--- diff --git a/src/test/regress/expected/xc_rownum.out b/src/test/regress/expected/xc_rownum.out index b9267f09c..786195d48 100644 --- a/src/test/regress/expected/xc_rownum.out +++ b/src/test/regress/expected/xc_rownum.out @@ -231,13 +231,13 @@ select rownum rn from distributors group by rn; 4 (4 rows) -select rownum + 1 from dual group by rownum; +select rownum + 1 group by rownum; ?column? ---------- 2 (1 row) -select rownum + 1 rn from dual group by rn; +select rownum + 1 rn group by rn; rn ---- 2 diff --git a/src/test/regress/sql/hw_cursor_part3.sql b/src/test/regress/sql/hw_cursor_part3.sql index 556805736..e88c61894 100644 --- a/src/test/regress/sql/hw_cursor_part3.sql +++ b/src/test/regress/sql/hw_cursor_part3.sql @@ -198,7 +198,7 @@ b varchar; sql_srt varchar(100); cursor c1 is select c1,c2 from cursor_vl_tb10 order by 1,2; begin -sql_srt :='insert into cursor_vl_tb10(c1,c2) select :1,:1+1 from dual;'; +sql_srt :='insert into cursor_vl_tb10(c1,c2) select :1,:1+1;'; while a1 > 0 loop execute immediate sql_srt using IN a1; a1:=a1-1; diff --git a/src/test/regress/sql/hw_datatype.sql b/src/test/regress/sql/hw_datatype.sql index bc4f770e0..0e43fda32 100644 --- a/src/test/regress/sql/hw_datatype.sql +++ b/src/test/regress/sql/hw_datatype.sql @@ -178,8 +178,8 @@ BEGIN END; $$ LANGUAGE plpgsql; -select TEST_FUNC('abc'::clob) from dual; -select TEST_FUNC('abc'::varchar2) from dual; +select TEST_FUNC('abc'::clob); +select TEST_FUNC('abc'::varchar2); drop function test_func(char); --VARCHAR2 @@ -189,14 +189,14 @@ BEGIN END; $$ LANGUAGE plpgsql; -select TEST_FUNC('abc'::clob) from dual; -select TEST_FUNC(123) from dual; -select TEST_FUNC('123'::integer) from dual; -select TEST_FUNC('abc'::raw) from dual; -select TEST_FUNC('abc'::char) from dual; -select TEST_FUNC('2012-08-01 11:23:45'::timestamp) from dual; --with timezone? -select TEST_FUNC(interval '1 18:00:00' day to second) from dual; -select TEST_FUNC('1 day 18:00:00') from dual; +select TEST_FUNC('abc'::clob); +select TEST_FUNC(123); +select TEST_FUNC('123'::integer); +select TEST_FUNC('abc'::raw); +select TEST_FUNC('abc'::char); +select TEST_FUNC('2012-08-01 11:23:45'::timestamp); --with timezone? +select TEST_FUNC(interval '1 18:00:00' day to second); +select TEST_FUNC('1 day 18:00:00'); drop function test_func(varchar2); @@ -207,8 +207,8 @@ BEGIN END; $$ LANGUAGE plpgsql; -select TEST_FUNC('abc'::char) from dual; -select TEST_FUNC('abc'::varchar2) from dual; +select TEST_FUNC('abc'::char); +select TEST_FUNC('abc'::varchar2); drop function test_func(clob); @@ -219,8 +219,8 @@ BEGIN END; $$ LANGUAGE plpgsql; -select TEST_FUNC('123'::char(3)) from dual; -select TEST_FUNC('123'::varchar2) from dual; +select TEST_FUNC('123'::char(3)); +select TEST_FUNC('123'::varchar2); drop function test_func(integer); --TIMESTAMP @@ -230,8 +230,8 @@ BEGIN END; $$ LANGUAGE plpgsql; -select TEST_FUNC('2012-08-01 11:23:45'::char(20)) from dual; -select TEST_FUNC('2012-08-01 11:23:45'::varchar2) from dual; +select TEST_FUNC('2012-08-01 11:23:45'::char(20)); +select TEST_FUNC('2012-08-01 11:23:45'::varchar2); drop function test_func(timestamp); --INTERVAL @@ -240,8 +240,8 @@ BEGIN raise info'TEST INTERVAL VALUE IS %',tempdata; END; $$ LANGUAGE plpgsql; -select TEST_FUNC('1 day 18:00:00'::char(20)) from dual; -select TEST_FUNC('1 day 18:00:00'::varchar2) from dual; +select TEST_FUNC('1 day 18:00:00'::char(20)); +select TEST_FUNC('1 day 18:00:00'::varchar2); drop function test_func(INTERVAL); create function ftime(a abstime)returns int diff --git a/src/test/regress/sql/hw_datatype_3.sql b/src/test/regress/sql/hw_datatype_3.sql index 74991d2a5..f0fcd6492 100644 --- a/src/test/regress/sql/hw_datatype_3.sql +++ b/src/test/regress/sql/hw_datatype_3.sql @@ -185,14 +185,14 @@ drop table date_smalldate; --INTERAL TO NUMERIC create table test_num(mynum numeric); -select to_date('2013-03-14 14:27:00','YYYY-MM-DD HH24:MI:SS') - to_date('2013-3-1 9:00:00','YYYY-MM-DD HH24:MI:SS') from dual; +select to_date('2013-03-14 14:27:00','YYYY-MM-DD HH24:MI:SS') - to_date('2013-3-1 9:00:00','YYYY-MM-DD HH24:MI:SS'); insert into test_num values(to_date('2013-03-14 14:27:00','YYYY-MM-DD HH24:MI:SS') - to_date('2013-3-1 9:00:00','YYYY-MM-DD HH24:MI:SS')); select mynum from test_num order by 1; insert into test_num values(interval '2 days 09:33:00'); select mynum from test_num order by 1; select floor(mynum) from test_num order by 1; drop table test_num; -select floor(interval '2 days 09:33:00') from dual; +select floor(interval '2 days 09:33:00'); create or replace procedure test_interval_to_num(my_num numeric) as diff --git a/src/test/regress/sql/hw_empty_str_to_null.sql b/src/test/regress/sql/hw_empty_str_to_null.sql index b4571b258..e08cdd877 100644 --- a/src/test/regress/sql/hw_empty_str_to_null.sql +++ b/src/test/regress/sql/hw_empty_str_to_null.sql @@ -18,8 +18,8 @@ insert into test_tb values (1, ''); select * from test_tb where name is null; drop table test_tb; --- select * from ( select 'NULL' from dual); -select * from ( select 'NULL' from dual) as a; +-- select * from ( select 'NULL'); +select * from ( select 'NULL') as a; /* * function test @@ -37,14 +37,14 @@ select ltrim('abc', 'a') is not null; /* The following case depence on nvl which is added by GuassDB */ /* expect is null */ -select nvl(ltrim(NULL), 'is null') from dual; -select nvl(ltrim(''), 'is null') from dual; -select nvl(ltrim('', 'ab'), 'is null') from dual; -select nvl(ltrim(NULL, 'ab'), 'is null') from dual; -select nvl(ltrim('ab', ''), 'is null') from dual; -select nvl(ltrim('ab', NULL), 'is null') from dual; -select nvl(ltrim('ab', 'ab'), 'is null') from dual; -select nvl(ltrim('abc', 'a'), 'is not null') from dual; -- return bc +select nvl(ltrim(NULL), 'is null'); +select nvl(ltrim(''), 'is null'); +select nvl(ltrim('', 'ab'), 'is null'); +select nvl(ltrim(NULL, 'ab'), 'is null'); +select nvl(ltrim('ab', ''), 'is null'); +select nvl(ltrim('ab', NULL), 'is null'); +select nvl(ltrim('ab', 'ab'), 'is null'); +select nvl(ltrim('abc', 'a'), 'is not null'); -- return bc /* expect t */ @@ -117,8 +117,8 @@ select * from test_table where regexp_like(name,'', 'i'); ---return null select * from test_table where regexp_like(name, NULL, 'i'); -- return null drop table test_table; -select nvl(regexp_substr('This is test',''), 'This is NULL') from dual; -- return This is NULL -select nvl(regexp_substr('This is test',NULL), 'This is NULL') from dual; -- return This is NULL +select nvl(regexp_substr('This is test',''), 'This is NULL'); -- return This is NULL +select nvl(regexp_substr('This is test',NULL), 'This is NULL'); -- return This is NULL select concat(NULL, NULL) is null; diff --git a/src/test/regress/sql/hw_func_return_out.sql b/src/test/regress/sql/hw_func_return_out.sql index 06380ddb7..1c99039a5 100644 --- a/src/test/regress/sql/hw_func_return_out.sql +++ b/src/test/regress/sql/hw_func_return_out.sql @@ -10,7 +10,7 @@ AS END; / -SELECT test_return(1) from dual; +SELECT test_return(1); declare a int := 1; @@ -47,7 +47,7 @@ AS END; / -SELECT test_return1(1) from dual; +SELECT test_return1(1); declare a int := 1; @@ -127,7 +127,7 @@ AS END; / -SELECT test_return5(1) from dual; +SELECT test_return5(1); declare a int := 1; @@ -610,7 +610,7 @@ AS END; / -SELECT test_return(1) from dual; +SELECT test_return(1); declare a int := 1; @@ -647,7 +647,7 @@ AS END; / -SELECT test_return1(1) from dual; +SELECT test_return1(1); declare a int := 1; @@ -727,7 +727,7 @@ AS END; / -SELECT test_return5(1) from dual; +SELECT test_return5(1); declare a int := 1; diff --git a/src/test/regress/sql/hw_function_p_4.sql b/src/test/regress/sql/hw_function_p_4.sql index 12b712c5d..f8857e0bf 100644 --- a/src/test/regress/sql/hw_function_p_4.sql +++ b/src/test/regress/sql/hw_function_p_4.sql @@ -63,7 +63,7 @@ returns integer language plpgsql as $$ declare begin -create temp table test_create_tmp as (select sysdate as s from dual); +create temp table test_create_tmp as (select sysdate as s); ret :=0; end $$ ; @@ -146,12 +146,12 @@ returns integer language plpgsql as $$ declare begin -create temp table test_create_tmp as (select sysdate as s from dual); +create temp table test_create_tmp as (select sysdate as s); ret :=0; insert into test_create_tmp_no_exit values (2); exception when others then -create temp table test_create_tmp as (select sysdate as s from dual); +create temp table test_create_tmp as (select sysdate as s); ret :=1; end $$ ; diff --git a/src/test/regress/sql/hw_groupingsets.sql b/src/test/regress/sql/hw_groupingsets.sql index 2a7201380..386a6aa93 100644 --- a/src/test/regress/sql/hw_groupingsets.sql +++ b/src/test/regress/sql/hw_groupingsets.sql @@ -224,7 +224,7 @@ explain (format JSON) select a, b, c from vec_t1 group by rollup(a, b, c); explain (format YAML) select a, b, c from vec_t1 group by rollup(a, b, c); \o drop table vec_t1; -select 1 a,2,count(*) from dual group by cube(1,2) having count(*)=1 order by 1, 2; +select 1 a,2,count(*) group by cube(1,2) having count(*)=1 order by 1, 2; create table vec_t1(a int)with(orientation = column); insert into vec_t1 values(1); diff --git a/src/test/regress/sql/hw_to_timestamp.sql b/src/test/regress/sql/hw_to_timestamp.sql index 126c3adae..197f4788a 100644 --- a/src/test/regress/sql/hw_to_timestamp.sql +++ b/src/test/regress/sql/hw_to_timestamp.sql @@ -43,169 +43,169 @@ SELECT TO_TIMESTAMP('60','DDD-PS'); SELECT TO_TIMESTAMP('366-4','YYYY-P'); SELECT TO_TIMESTAMP('366-4','YYYY-DD-12'); -select to_timestamp('-4713','YYYY') from dual; -select to_timestamp('-4712','YYYY') from dual; -select to_timestamp('-1','YYYY') from dual; -select to_timestamp('0','YYYY') from dual; -select to_timestamp('1','YYYY') from dual; -select to_timestamp('9999','YYYY') from dual; -select to_timestamp('10000','YYYY') from dual; +select to_timestamp('-4713','YYYY'); +select to_timestamp('-4712','YYYY'); +select to_timestamp('-1','YYYY'); +select to_timestamp('0','YYYY'); +select to_timestamp('1','YYYY'); +select to_timestamp('9999','YYYY'); +select to_timestamp('10000','YYYY'); -select to_timestamp('10','H24') from dual; -select to_timestamp('10','H24') from dual; +select to_timestamp('10','H24'); +select to_timestamp('10','H24'); -SELECT to_timestamp('-2012-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF') FROM DUAL; -SELECT to_timestamp('-1-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF') FROM DUAL; -SELECT to_timestamp('0-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF') FROM DUAL; -SELECT to_timestamp('9999-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF') FROM DUAL; -SELECT to_timestamp('10000-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF') FROM DUAL; +SELECT to_timestamp('-2012-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF'); +SELECT to_timestamp('-1-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF'); +SELECT to_timestamp('0-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF'); +SELECT to_timestamp('9999-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF'); +SELECT to_timestamp('10000-2/3,21.15;36:18','YYYY-MM/DD,HH24.MI;SS:FF'); -select to_timestamp('-4713-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('-4712-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('0-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('9999-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('10000-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff'); +select to_timestamp('-4712-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff'); +select to_timestamp('0-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff'); +select to_timestamp('9999-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff'); +select to_timestamp('10000-3-4 13:2:3.234015', 'syyyy-mm-dd hh24:mi:ss.ff'); -select to_timestamp('-4713-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('-4712-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('0-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('9999-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('10000-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff'); +select to_timestamp('-4712-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff'); +select to_timestamp('0-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff'); +select to_timestamp('9999-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff'); +select to_timestamp('10000-3-4 13:2:3.234015', 'SYYYY-mm-dd hh24:mi:ss.ff'); -select to_timestamp('-4713-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('-4712-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('-1-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('0-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('1-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('9999-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('10000-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('-4712-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('-1-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('0-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('1-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('9999-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('10000-3-4 13:2:3.234015', 'RR-mm-dd hh24:mi:ss.ff'); -select to_timestamp('-4713-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('-4712-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('-1-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('0-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('1-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('9999-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('10000-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('-4712-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('-1-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('0-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('1-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('9999-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); +select to_timestamp('10000-3-4 13:2:3.234015', 'RRRR-mm-dd hh24:mi:ss.ff'); -select to_timestamp('-4713-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('-4712-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('-1-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('0-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('1-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('9999-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('10000-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('-4712-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('-1-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('0-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('1-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('9999-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('10000-3-4 13:2:3.234015', 'rr-mm-dd hh24:mi:ss.ff'); -select to_timestamp('-4713-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('-4712-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('-1-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('0-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('1-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('9999-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; -select to_timestamp('10000-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff') from dual; +select to_timestamp('-4713-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('-4712-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('-1-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('0-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('1-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('9999-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); +select to_timestamp('10000-3-4 13:2:3.234015', 'rrrr-mm-dd hh24:mi:ss.ff'); -SELECT TO_TIMESTAMP('0000-09-01','YYYYY-MM-DD') FROM DUAL; -SELECT TO_TIMESTAMP('0000-09-01','SYYYYY-MM-DD') FROM DUAL; -SELECT TO_TIMESTAMP('0000-09-01','SYYYY-Y-MM-DD') FROM DUAL; +SELECT TO_TIMESTAMP('0000-09-01','YYYYY-MM-DD'); +SELECT TO_TIMESTAMP('0000-09-01','SYYYYY-MM-DD'); +SELECT TO_TIMESTAMP('0000-09-01','SYYYY-Y-MM-DD'); -SELECT TO_TIMESTAMP('25361','SSSSS') FROM DUAL; -SELECT TO_TIMESTAMP('25361-2','SSSSS-HH12') FROM DUAL; -SELECT TO_TIMESTAMP('25361-07','SSSSS-HH12') FROM DUAL; -SELECT TO_TIMESTAMP('25361-2','SSSSS-MI') FROM DUAL; -SELECT TO_TIMESTAMP('25361-10','SSSSS-MI') FROM DUAL; -SELECT TO_TIMESTAMP('25361-2','SSSSS-SS') FROM DUAL; -SELECT TO_TIMESTAMP('25361-41','SSSSS-SS') FROM DUAL; +SELECT TO_TIMESTAMP('25361','SSSSS'); +SELECT TO_TIMESTAMP('25361-2','SSSSS-HH12'); +SELECT TO_TIMESTAMP('25361-07','SSSSS-HH12'); +SELECT TO_TIMESTAMP('25361-2','SSSSS-MI'); +SELECT TO_TIMESTAMP('25361-10','SSSSS-MI'); +SELECT TO_TIMESTAMP('25361-2','SSSSS-SS'); +SELECT TO_TIMESTAMP('25361-41','SSSSS-SS'); -SELECT TO_TIMESTAMP('2650000','J') FROM DUAL; -SELECT TO_TIMESTAMP('2650000-2542','J-YYYY') FROM DUAL; -SELECT TO_TIMESTAMP('2650000-2543','J-YYYY') FROM DUAL; -SELECT TO_TIMESTAMP('2650000-4','J-MM') FROM DUAL; -SELECT TO_TIMESTAMP('2650000-5','J-MM') FROM DUAL; -SELECT TO_TIMESTAMP('2650000-8','J-DD') FROM DUAL; -SELECT TO_TIMESTAMP('2650000-9','J-DD') FROM DUAL; +SELECT TO_TIMESTAMP('2650000','J'); +SELECT TO_TIMESTAMP('2650000-2542','J-YYYY'); +SELECT TO_TIMESTAMP('2650000-2543','J-YYYY'); +SELECT TO_TIMESTAMP('2650000-4','J-MM'); +SELECT TO_TIMESTAMP('2650000-5','J-MM'); +SELECT TO_TIMESTAMP('2650000-8','J-DD'); +SELECT TO_TIMESTAMP('2650000-9','J-DD'); -SELECT TO_TIMESTAMP('2012-245','YYYY-DDD') FROM DUAL; -SELECT TO_TIMESTAMP('2012-245-8','YYYY-DDD-MM') FROM DUAL; -SELECT TO_TIMESTAMP('2012-245-9','YYYY-DDD-MM') FROM DUAL; -SELECT TO_TIMESTAMP('2012-245-1','YYYY-DDD-DD') FROM DUAL; -SELECT TO_TIMESTAMP('2012-245-2','YYYY-DDD-DD') FROM DUAL; +SELECT TO_TIMESTAMP('2012-245','YYYY-DDD'); +SELECT TO_TIMESTAMP('2012-245-8','YYYY-DDD-MM'); +SELECT TO_TIMESTAMP('2012-245-9','YYYY-DDD-MM'); +SELECT TO_TIMESTAMP('2012-245-1','YYYY-DDD-DD'); +SELECT TO_TIMESTAMP('2012-245-2','YYYY-DDD-DD'); --MS -SELECT TO_TIMESTAMP('-1','MS') FROM DUAL; -SELECT TO_TIMESTAMP('0','MS') FROM DUAL; -SELECT TO_TIMESTAMP('256','MS') FROM DUAL; -SELECT TO_TIMESTAMP('999','MS') FROM DUAL; -SELECT TO_TIMESTAMP('1000','MS') FROM DUAL; +SELECT TO_TIMESTAMP('-1','MS'); +SELECT TO_TIMESTAMP('0','MS'); +SELECT TO_TIMESTAMP('256','MS'); +SELECT TO_TIMESTAMP('999','MS'); +SELECT TO_TIMESTAMP('1000','MS'); --WW -SELECT TO_TIMESTAMP('0','WW') FROM DUAL; -SELECT TO_TIMESTAMP('1','WW') FROM DUAL; -SELECT TO_TIMESTAMP('10','WW') FROM DUAL; -SELECT TO_TIMESTAMP('53','WW') FROM DUAL; -SELECT TO_TIMESTAMP('54','WW') FROM DUAL; +SELECT TO_TIMESTAMP('0','WW'); +SELECT TO_TIMESTAMP('1','WW'); +SELECT TO_TIMESTAMP('10','WW'); +SELECT TO_TIMESTAMP('53','WW'); +SELECT TO_TIMESTAMP('54','WW'); --D -SELECT TO_TIMESTAMP('0','D') FROM DUAL; -SELECT TO_TIMESTAMP('1','D') FROM DUAL; -SELECT TO_TIMESTAMP('4','D') FROM DUAL; -SELECT TO_TIMESTAMP('7','D') FROM DUAL; -SELECT TO_TIMESTAMP('8','D') FROM DUAL; +SELECT TO_TIMESTAMP('0','D'); +SELECT TO_TIMESTAMP('1','D'); +SELECT TO_TIMESTAMP('4','D'); +SELECT TO_TIMESTAMP('7','D'); +SELECT TO_TIMESTAMP('8','D'); --WW & D YYYY -SELECT TO_TIMESTAMP('2012-50-0','YYYY-WW-D') FROM DUAL; -SELECT TO_TIMESTAMP('2012-50-1','YYYY-WW-D') FROM DUAL; -SELECT TO_TIMESTAMP('2012-50-4','YYYY-WW-D') FROM DUAL; -SELECT TO_TIMESTAMP('2012-50-7','YYYY-WW-D') FROM DUAL; -SELECT TO_TIMESTAMP('2012-50-8','YYYY-WW-D') FROM DUAL; -SELECT TO_TIMESTAMP('2012-0-4','YYYY-WW-D') FROM DUAL; -SELECT TO_TIMESTAMP('2012-1-4','YYYY-WW-D') FROM DUAL; -SELECT TO_TIMESTAMP('2012-50-4','YYYY-WW-D') FROM DUAL; -SELECT TO_TIMESTAMP('2012-53-4','YYYY-WW-D') FROM DUAL; -SELECT TO_TIMESTAMP('2012-54-4','YYYY-WW-D') FROM DUAL; +SELECT TO_TIMESTAMP('2012-50-0','YYYY-WW-D'); +SELECT TO_TIMESTAMP('2012-50-1','YYYY-WW-D'); +SELECT TO_TIMESTAMP('2012-50-4','YYYY-WW-D'); +SELECT TO_TIMESTAMP('2012-50-7','YYYY-WW-D'); +SELECT TO_TIMESTAMP('2012-50-8','YYYY-WW-D'); +SELECT TO_TIMESTAMP('2012-0-4','YYYY-WW-D'); +SELECT TO_TIMESTAMP('2012-1-4','YYYY-WW-D'); +SELECT TO_TIMESTAMP('2012-50-4','YYYY-WW-D'); +SELECT TO_TIMESTAMP('2012-53-4','YYYY-WW-D'); +SELECT TO_TIMESTAMP('2012-54-4','YYYY-WW-D'); --US -SELECT TO_TIMESTAMP('-1','US') FROM DUAL; -SELECT TO_TIMESTAMP('0','US') FROM DUAL; -SELECT TO_TIMESTAMP('99999','US') FROM DUAL; -SELECT TO_TIMESTAMP('999999','US') FROM DUAL; -SELECT TO_TIMESTAMP('1000000','US') FROM DUAL; +SELECT TO_TIMESTAMP('-1','US'); +SELECT TO_TIMESTAMP('0','US'); +SELECT TO_TIMESTAMP('99999','US'); +SELECT TO_TIMESTAMP('999999','US'); +SELECT TO_TIMESTAMP('1000000','US'); --W -SELECT TO_TIMESTAMP('-1','W') FROM DUAL; -SELECT TO_TIMESTAMP('0','W') FROM DUAL; -SELECT TO_TIMESTAMP('1','W') FROM DUAL; -SELECT TO_TIMESTAMP('5','W') FROM DUAL; -SELECT TO_TIMESTAMP('6','W') FROM DUAL; +SELECT TO_TIMESTAMP('-1','W'); +SELECT TO_TIMESTAMP('0','W'); +SELECT TO_TIMESTAMP('1','W'); +SELECT TO_TIMESTAMP('5','W'); +SELECT TO_TIMESTAMP('6','W'); SHOW nls_timestamp_format; -SELECT TO_TIMESTAMP('01') FROM DUAL; -SELECT TO_TIMESTAMP('01-Sep') FROM DUAL; -SELECT TO_TIMESTAMP('01-Sep-1998') FROM DUAL; -SELECT TO_TIMESTAMP('01-Sep-1998 11') FROM DUAL; -SELECT TO_TIMESTAMP('01-Sep-1998 11:12') FROM DUAL; -SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13') FROM DUAL; -SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13.12') FROM DUAL; -SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13.12 PM') FROM DUAL; -SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13 PM') FROM DUAL; +SELECT TO_TIMESTAMP('01'); +SELECT TO_TIMESTAMP('01-Sep'); +SELECT TO_TIMESTAMP('01-Sep-1998'); +SELECT TO_TIMESTAMP('01-Sep-1998 11'); +SELECT TO_TIMESTAMP('01-Sep-1998 11:12'); +SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13'); +SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13.12'); +SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13.12 PM'); +SELECT TO_TIMESTAMP('01-Sep-1998 11:12:13 PM'); SET nls_timestamp_format = 'YYYY-MM-DD HH:MI:SS.FF AM'; SHOW nls_timestamp_format; -SELECT TO_TIMESTAMP('1998') FROM DUAL; -SELECT TO_TIMESTAMP('1998-12-28') FROM DUAL; -SELECT TO_TIMESTAMP('1998-12-28 01') FROM DUAL; -SELECT TO_TIMESTAMP('1998-12-28 01:02') FROM DUAL; -SELECT TO_TIMESTAMP('1998-12-28 01:02:03') FROM DUAL; -SELECT TO_TIMESTAMP('1998-12-28 01:02:03.12') FROM DUAL; -SELECT TO_TIMESTAMP('1998-12-28 01:02:03.12 AM') FROM DUAL; -SELECT TO_TIMESTAMP('1998-12-28 11:12:13 PM') FROM DUAL; -SELECT TO_TIMESTAMP('01') FROM DUAL; -select to_date('2018--12;30', 'yyyy//mm/,,dd') from dual; -select to_date('2018-12 30', 'yyyy//mm/dd') from dual; +SELECT TO_TIMESTAMP('1998'); +SELECT TO_TIMESTAMP('1998-12-28'); +SELECT TO_TIMESTAMP('1998-12-28 01'); +SELECT TO_TIMESTAMP('1998-12-28 01:02'); +SELECT TO_TIMESTAMP('1998-12-28 01:02:03'); +SELECT TO_TIMESTAMP('1998-12-28 01:02:03.12'); +SELECT TO_TIMESTAMP('1998-12-28 01:02:03.12 AM'); +SELECT TO_TIMESTAMP('1998-12-28 11:12:13 PM'); +SELECT TO_TIMESTAMP('01'); +select to_date('2018--12;30', 'yyyy//mm/,,dd'); +select to_date('2018-12 30', 'yyyy//mm/dd'); select to_date('20181231124559','yyyy-MM-dd hh24:mi:ss'); -SELECT (TO_DATE('1999(12*23 12 26','yyyy-MM-dd hh24:mi:ss')) FROM dual; -SELECT (TO_DATE('1999(12*23 12 26','yyyy-MM-dd hh24:mi:ss')) FROM dual; +SELECT (TO_DATE('1999(12*23 12 26','yyyy-MM-dd hh24:mi:ss')); +SELECT (TO_DATE('1999(12*23 12 26','yyyy-MM-dd hh24:mi:ss')); SELECT (TO_DATE('1999(12*23 12 -26','yyyy-MM-dd hh24:mi:ss')) FROM dual; +26','yyyy-MM-dd hh24:mi:ss')); SELECT to_date('10', 'SSSSS'); -SELECT TO_TIMESTAMP('01', 'yyyy-MM-dd') FROM DUAL; -SELECT TO_CHAR(TO_DATE('27OCT17', 'DDMONRR') ,'YYYY') "Year" FROM DUAL; -SELECT TO_CHAR(TO_DATE('27-OCT98', 'DD-MON-RR') ,'YYYY') "Year" FROM DUAL; -SELECT TO_CHAR(TO_DATE('27DEC98', 'DDMON-RR') ,'MON') "Month" FROM DUAL; -SELECT TO_CHAR(TO_DATE('27/OCT/17', 'DD-MON-RR') ,'DD') "Year" FROM DUAL; +SELECT TO_TIMESTAMP('01', 'yyyy-MM-dd'); +SELECT TO_CHAR(TO_DATE('27OCT17', 'DDMONRR') ,'YYYY') "Year"; +SELECT TO_CHAR(TO_DATE('27-OCT98', 'DD-MON-RR') ,'YYYY') "Year"; +SELECT TO_CHAR(TO_DATE('27DEC98', 'DDMON-RR') ,'MON') "Month"; +SELECT TO_CHAR(TO_DATE('27/OCT/17', 'DD-MON-RR') ,'DD') "Year"; SELECT to_date('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 11111'); SELECT to_date('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 11111'); diff --git a/src/test/regress/sql/interval.sql b/src/test/regress/sql/interval.sql index 8359e369b..8ee40fe20 100644 --- a/src/test/regress/sql/interval.sql +++ b/src/test/regress/sql/interval.sql @@ -15,7 +15,7 @@ SELECT INTERVAL '1.5 weeks' AS "Ten days twelve hours"; SELECT INTERVAL '1.5 months' AS "One month 15 days"; SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years..."; --check interval concat null -SELECT '' || INTERVAL '10 years -11 month -12 days +13:14' AS "9 years..." from dual; +SELECT '' || INTERVAL '10 years -11 month -12 days +13:14' AS "9 years..."; CREATE TABLE INTERVAL_TBL (f1 interval); @@ -197,7 +197,7 @@ SELECT interval '1 2.3456' minute to second(2); SELECT interval '1 2:03.5678' minute to second(2); SELECT interval '1 2:03:04.5678' minute to second(2); --check interval concat with null -SELECT interval '1 2:03:04.5678' minute to second(2) || '' from dual; +SELECT interval '1 2:03:04.5678' minute to second(2) || ''; -- test casting to restricted precision (bug #14479) SELECT f1, diff --git a/src/test/regress/sql/llt_atc.sql b/src/test/regress/sql/llt_atc.sql index 04f542721..87709a566 100644 --- a/src/test/regress/sql/llt_atc.sql +++ b/src/test/regress/sql/llt_atc.sql @@ -1,6 +1,6 @@ -- add test case into 'case DCH_RRRR' and 'case DCH_RR' in DCH_from_char function, then the function adjust_partial_year_to_current_year will covered: -select to_date('06-JAN-40 00:00:00','DD-MON-RRRR HH24:MI:SS') from dual; -select to_date('01/05/81','dd/mm/rr') from dual; +select to_date('06-JAN-40 00:00:00','DD-MON-RRRR HH24:MI:SS'); +select to_date('01/05/81','dd/mm/rr'); -- add test case for float4_to_char function select to_char(0.15::float4); diff --git a/src/test/regress/sql/resolve_unknown.sql b/src/test/regress/sql/resolve_unknown.sql index 5707ac06c..76b85c241 100644 --- a/src/test/regress/sql/resolve_unknown.sql +++ b/src/test/regress/sql/resolve_unknown.sql @@ -3,10 +3,10 @@ select pg_typeof('vasya'), 'vasya' is of (unknown); explain (verbose on, costs off) select 1 where 'vasya' = (select 'vasya' as col1); explain (verbose on, costs off) select 1 where 'vasya' = (select 'vasya' as col1 where col1 <> 'aaa'); -explain (verbose on, costs off) select 1 where 'vasya' = (select 'vasya' as col1 from dual where col1 <> 'aaa'); +explain (verbose on, costs off) select 1 where 'vasya' = (select 'vasya' as col1 where col1 <> 'aaa'); select 1 where 'vasya' = (select 'vasya' as col1); select 1 where 'vasya' = (select 'vasya' as col1 where col1 <> 'aaa'); -select 1 where 'vasya' = (select 'vasya' as col1 from dual where col1 <> 'aaa'); +select 1 where 'vasya' = (select 'vasya' as col1 where col1 <> 'aaa'); explain (verbose on, costs off) select pg_typeof(col1), col1, col1 is of (unknown), col1 is of (text) from (select 'vasya' as col1) order by col1; explain (verbose on, costs off) select pg_typeof(col1), col1, col1 is of (unknown), col1 is of (text) from (select 'vasya' as col1) group by col1; @@ -66,7 +66,7 @@ INSERT INTO test_unknown(a, b) VALUES (1, 'beijing'); INSERT INTO test_unknown(a, b) VALUES (1, 'beijing') LIMIT 1; INSERT INTO test_unknown(a, b) VALUES (2, 'shenzhen'), (3, 'shanghai'); INSERT INTO test_unknown(a, b) VALUES (4, 'suzhou'), (5, 'hangzhou') ORDER BY 1 LIMIT 1; -INSERT INTO test_unknown(a, b) SELECT 6, 'xian' FROM DUAL; +INSERT INTO test_unknown(a, b) SELECT 6, 'xian'; TABLE test_unknown ORDER BY a; TRUNCATE test_unknown; @@ -74,7 +74,7 @@ INSERT INTO test_unknown(a, b) VALUES (1, 'beijing'); INSERT INTO test_unknown(a, b) VALUES (1, 'beijing') LIMIT 1; INSERT INTO test_unknown(a, b) VALUES (2, 'shenzhen'), (3, 'shanghai'); INSERT INTO test_unknown(a, b) VALUES (4, 'suzhou'), (5, 'hangzhou') ORDER BY 1 LIMIT 1; -INSERT INTO test_unknown(a, b) SELECT 6, 'xian' FROM DUAL; +INSERT INTO test_unknown(a, b) SELECT 6, 'xian'; TABLE test_unknown ORDER BY a; diff --git a/src/test/regress/sql/xc_rownum.sql b/src/test/regress/sql/xc_rownum.sql index c0a40a971..134a5f6da 100644 --- a/src/test/regress/sql/xc_rownum.sql +++ b/src/test/regress/sql/xc_rownum.sql @@ -86,8 +86,8 @@ select rownum, name from (select name from distributors where rownum <= 4 inters --test group by select rownum from distributors group by rownum; select rownum rn from distributors group by rn; -select rownum + 1 from dual group by rownum; -select rownum + 1 rn from dual group by rn; +select rownum + 1 group by rownum; +select rownum + 1 rn group by rn; --test having select id from distributors group by rownum,id having rownum < 5;