Search Postgresql Archives

Timestamp parsing with blanked time part

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

consider the following:

select quote_literal(blank_hms) as "quote_literal(blank_hms)", blank_hms::timestamp as "blank_hms::timestamp" from (select unnest(array['2011-07-22 :', '2011-07-22 : ', '2011-07-22 : : ']::text[]) as blank_hms) a; select version();

 quote_literal(blank_hms) | blank_hms::timestamp
--------------------------+----------------------
 '2011-07-22 :'           | 2011-07-22 00:00:00
 '2011-07-22 : '          | 2011-07-22 00:00:00
 '2011-07-22 : : '        | 2011-07-22 00:00:00
(3 rows)

Time: 0.264 ms
                                                     version
------------------------------------------------------------------------------------------------------------------
PostgreSQL 9.0.3 on x86_64-manual_install-freebsd8.x, compiled by GCC cc (GCC) 4.2.1 20070719 [FreeBSD], 64-bit
(1 row)

The result is what might be expected by the common sense means.

Howewer, the input format of the example datetime strings is definitely wrong as far as I guess. Some other datetime parsers reject it, the Perl DateTime::Format::Pg is an example.

Is this case a subject of eventual corrections in the future versions of postgres and it would start emit errors then?

Thanks
Irek.

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux