ERROR: "TZ"/"tz" not supported

Started by Sergey Levchenkoalmost 21 years ago3 messagesgeneral
Jump to latest
#1Sergey Levchenko
sector119@gmail.com

When I execute query, I've got error message.

test=> SELECT to_timestamp('00:00:05.601 SAMST Tue Jun 28 2005',
'HH24:MI:SS.MS TZ Dy Mon DD YYYY');
ERROR: "TZ"/"tz" not supported

How can I convert '00:00:05.601 SAMST Tue Jun 28 2005' (varchar type)
to timestamp with time zone?

#2Sergey Levchenko
sector119@gmail.com
In reply to: Sergey Levchenko (#1)

When I execute query, I've got error message.

test=> SELECT to_timestamp('00:00:05.601 SAMST Tue Jun 28 2005',
'HH24:MI:SS.MS TZ Dy Mon DD YYYY');
ERROR: "TZ"/"tz" not supported

How can I convert '00:00:05.601 SAMST Tue Jun 28 2005' (varchar type)
to timestamp with time zone?

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Sergey Levchenko (#1)
Re: ERROR: "TZ"/"tz" not supported

Sergey Levchenko <sector119@gmail.com> writes:

How can I convert '00:00:05.601 SAMST Tue Jun 28 2005' (varchar type)
to timestamp with time zone?

Just casting it would work, except that SAMST is not one of the time
zone abbreviations known to Postgres. If you're desperate you could
add an entry to the table in datetime.c. (Someday we really need to
make that list configurable instead of hard-wired.)

regards, tom lane