Timezone Inconsistancies - Mailing list pgsql-hackers

From Arguile
Subject Timezone Inconsistancies
Date
Msg-id LLENKEMIODLDJNHBEFBOKEBJEEAA.arguile@lucentstudios.com
Whole thread Raw
In response to Re: More time zones  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Couldn't find these particular inconsistancy in the archives. If this has
already appeared, sorry.

1) Casting with and without timezones:
 =# SELECT time 'now';        now ------------------  21:31:33.9210-08 (1 row)

Works.
=# SELECT CURRENT_TIME::time;        now ------------------  21:31:33.9210-08 (1 row)

Same.
 =# SELECT now()::time; ERROR:  Cannot cast type 'timestamp with time zone' to 'time without time zone'

Hrmm... Inconsistant
 =# SELECT now()::timetz;        now ------------------  21:31:33.9210-08 (1 row)

That of course works.
 SELECT now()::date;     now ------------  2002-02-25 (1 row)

Again works.

I understand why it's not implicitly casting, but if tz can be ignored in
one it should exhibit the same behavoir for all.


2) Another inconsistancy is timestamp default to having a timezone, while
time does not, and dates not even having a date with timezone option:

::time      != ::timetz
::timestamp == ::timestamptz
::date      ??

Dates are just as effected by time zones as time is. 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.

Among other fun new timestamp changes ;)




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: More time zones
Next
From: Tom Lane
Date:
Subject: Re: More time zones