Re: cast not IMMUTABLE? - Mailing list pgsql-admin

From Alvaro Herrera
Subject Re: cast not IMMUTABLE?
Date
Msg-id 20050324133822.GC20726@dcc.uchile.cl
Whole thread Raw
In response to Re: cast not IMMUTABLE?  (Enrico Weigelt <weigelt@metux.de>)
List pgsql-admin
On Thu, Mar 24, 2005 at 02:15:52PM +0100, Enrico Weigelt wrote:
> * Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >
> > > why that cast is not considered IMMUTABLE ?
> >
> > Because it depends on your TimeZone setting.  Observe:
>
> BTW: whats really the difference between timezone and
> timezonetz ? I always used to use timestamp (w/o tz) and
> thought timestamptz was just an question of presentation.

The difference is that timestamptz converts the value from your local
timezone to UTC before storing; and at display time, it converts it back
to the local timezone.  So you can meaningfully compare data that was
inserted on different timezones.

Also, keep in mind that in past releases, "timestamp" was synonym for
"timestamp with time zone", while right now it is synonym for "timestamp
without time zone", and to get the former behavior you have to qualify
it with "with time zone" or use "timestamptz".  I think the switchover
was made in 7.3 but I don't remember exactly.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"When the proper man does nothing (wu-wei),
his thought is felt ten thousand miles." (Lao Tse)

pgsql-admin by date:

Previous
From: Enrico Weigelt
Date:
Subject: Re: cast not IMMUTABLE?
Next
From: "Magnus Hagander"
Date:
Subject: Re: public key authentification