Timestamp parsing with blanked time part - Mailing list pgsql-general

From Ireneusz Pluta
Subject Timestamp parsing with blanked time part
Date
Msg-id 4E293BEB.3070505@wp.pl
Whole thread Raw
List pgsql-general
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.

pgsql-general by date:

Previous
From: Harshitha S
Date:
Subject: Tracing in Postgres
Next
From: Ireneusz Pluta
Date:
Subject: Timestamp parsing with blanked time part