BUG #1020: Timestamp representation printed by PostgreSQL are invalid

Started by PostgreSQL Bugs Listover 22 years ago2 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

The following bug has been logged online:

Bug reference: 1020
Logged by: Sebastiano Vigna
Email address: vigna@dsi.unimi.it
PostgreSQL version: 7.3.4
Operating system: Linux
Description: Timestamp representation printed by PostgreSQL are invalid
Details:

create table test (t time);
select CURRENT_TIME;
timetz
--------------------
16:42:11.183148+01
(1 row)
insert into test VALUES('16:42:11.183148+01');
ERROR: Bad time external representation '16:42:11.183148+01'

This is nonsense: the representation returned by a SELECT for a data type should be *VALID*, shouldn't it?

I'm trying to pre-compute the default values of a field using SELECT as above, but when I try to fill the field I get an error, as above.

Ciao,

seba

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: BUG #1020: Timestamp representation printed by PostgreSQL are invalid

"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:

This is nonsense: the representation returned by a SELECT for a data type should be *VALID*, shouldn't it?

CURRENT_TIME delivers a timetz value, which is not the same datatype as
time.

Having said that, 7.4 will accept this input string for a time column;
it was suggested that since timestamp-without-time-zone allows and
ignores a time zone field, time-without-time-zone should too.

regards, tom lane