Re: cast not IMMUTABLE?

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Enrico Weigelt <weigelt(at)metux(dot)de>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: cast not IMMUTABLE?
Date: 2005-03-24 13:38:22
Message-ID: 20050324133822.GC20726@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On Thu, Mar 24, 2005 at 02:15:52PM +0100, Enrico Weigelt wrote:
> * Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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[(at)]dcc(dot)uchile(dot)cl>)
"When the proper man does nothing (wu-wei),
his thought is felt ten thousand miles." (Lao Tse)

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Magnus Hagander 2005-03-24 13:44:17 Re: public key authentification
Previous Message Enrico Weigelt 2005-03-24 13:15:52 Re: cast not IMMUTABLE?

Browse pgsql-hackers by date

  From Date Subject
Next Message Bort, Paul 2005-03-24 15:42:47 Re: RFC: built-in historical query time profiling
Previous Message Enrico Weigelt 2005-03-24 13:15:52 Re: cast not IMMUTABLE?