pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@dcc.uchile.cl>
To: Enrico Weigelt <weigelt@metux.de>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: cast not IMMUTABLE?
Date: Thu, 24 Mar 2005 09:38:22 -0400
Message-ID: <20050324133822.GC20726@dcc.uchile.cl> (raw)
In-Reply-To: <20050324131552.GB19555@nibiru.borg.metux.de>
References: <c7ei84$j0e$1@floppy.pyrenet.fr>
	<26503.1083890514@sss.pgh.pa.us>
	<20050324131552.GB19555@nibiru.borg.metux.de>

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)



view thread (7+ messages)

Message-ID: <20050324133822.GC20726@dcc.uchile.cl>
Permalink:  ../20050324133822.GC20726@dcc.uchile.cl/
Also on:    postgresql.org/message-id/20050324133822.GC20726@dcc.uchile.cl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: alvherre@dcc.uchile.cl, weigelt@metux.de
  Subject: Re: cast not IMMUTABLE?
  In-Reply-To: <20050324133822.GC20726@dcc.uchile.cl>
  References: <c7ei84$j0e$1@floppy.pyrenet.fr> <26503.1083890514@sss.pgh.pa.us> <20050324131552.GB19555@nibiru.borg.metux.de> <20050324133822.GC20726@dcc.uchile.cl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox