Thread: BUG #5132: Invalid Function

BUG #5132: Invalid Function

From
"Geok Hua Yap"
Date:
The following bug has been logged online:

Bug reference:      5132
Logged by:          Geok Hua Yap
Email address:      geokhua8888@yahoo.com.sg
PostgreSQL version: 8.3.1
Operating system:   CentOS 5.2
Description:        Invalid Function
Details:

select timeofday()::timestamp;
ERROR:  invalid input syntax for type timestamp: "Thu Oct 22 15:16:25.113963
2009 SGT"

Re: BUG #5132: Invalid Function

From
Robert Haas
Date:
On Thu, Oct 22, 2009 at 3:23 AM, Geok Hua Yap <geokhua8888@yahoo.com.sg> wr=
ote:
>
> The following bug has been logged online:
>
> Bug reference: =A0 =A0 =A05132
> Logged by: =A0 =A0 =A0 =A0 =A0Geok Hua Yap
> Email address: =A0 =A0 =A0geokhua8888@yahoo.com.sg
> PostgreSQL version: 8.3.1
> Operating system: =A0 CentOS 5.2
> Description: =A0 =A0 =A0 =A0Invalid Function
> Details:
>
> select timeofday()::timestamp;
> ERROR: =A0invalid input syntax for type timestamp: "Thu Oct 22 15:16:25.1=
13963
> 2009 SGT"

This is not a bug.  timeofday() returns text - maybe you want clock_timesta=
mp()?

http://www.postgresql.org/docs/current/interactive/functions-datetime.html

...Robert

Re: BUG #5132: Invalid Function

From
Tom Lane
Date:
"Geok Hua Yap" <geokhua8888@yahoo.com.sg> writes:
> select timeofday()::timestamp;
> ERROR:  invalid input syntax for type timestamp: "Thu Oct 22 15:16:25.113963
> 2009 SGT"

SGT was added to the default set of timezone abbreviations as of 8.4.
If you want to use Singapore timezone in 8.3, you'll probably want to
add it to your local copy of that configuration file.  See
http://www.postgresql.org/docs/8.3/static/datetime-config-files.html

            regards, tom lane