Re: Timezone Inconsistancies - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Timezone Inconsistancies
Date
Msg-id 27031.1014696323@sss.pgh.pa.us
Whole thread Raw
In response to Re: Timezone Inconsistancies  (Thomas Lockhart <lockhart@fourpalms.org>)
List pgsql-hackers
Thomas Lockhart <lockhart@fourpalms.org> writes:
>> ... The only way to cast to
>> timestamp without tz is CAST( ... without time zone) as far as I can tell;
>> as ::timestamp(p) doesn't work nor the w/ w/o tz in that style of casting.

> Right. The double-colon syntax is an ancient PgSQL-ism. Use cast()
> instead to get the greatest variety of syntax in coersions.

AFAICT, double-colon accepts exactly the same range of type names as CAST
does.  For example:

regression=# select 'now'::timestamp(3);       timestamptz
----------------------------2002-02-25 22:58:44.796-05
(1 row)

regression=# select 'now'::timestamp(3) with time zone;       timestamptz
----------------------------2002-02-25 23:00:04.235-05
(1 row)

regression=# select 'now'::timestamp(3) without time zone;       timestamp
-------------------------2002-02-25 23:00:08.075
(1 row)

regression=# select 'now'::"timestamp";        timestamp
----------------------------2002-02-25 23:00:17.104784
(1 row)

regression=# select 'now'::"timestamptz";         timestamptz
-------------------------------2002-02-25 23:00:19.644908-05
(1 row)



>> Among other fun new timestamp changes ;)

> Enjoy ;)

Yup, we've got some.  But hey, SQL99 compliance is good for you ;-)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Timezone Inconsistancies
Next
From: Thomas Lockhart
Date:
Subject: Re: More time zones