Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Date: 2003-02-19 17:55:30
Message-ID: 87vfzg17fx.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Greg Stark <gsstark(at)mit(dot)edu> writes:
> > I just don't see what use a timestamp that doesn't represent a particular time
> > would ever be. It seems to serve only as a gotcha for unwary programmers who
> > take the default.
>
> I have a problem with that too :-( ... timestamptz seems much the more
> generally useful type. But the SQL spec is pretty definite that
> "timestamp" means "timestamp without time zone".
>
> Is anybody interested in the idea of a GUC parameter to choose whether
> "timestamp" means "timestamp with time zone" (useful) or "timestamp
> without time zone" (anally spec-compliant)? Or would that just muddy
> the waters even more than they are already? We already changed the
> meaning once...

I think it would be a better idea to stick with the standard but spam the user
with plenty of notification that they're probably doing the wrong thing. I'm
thinking a warning whenever converting from timestamp with timezone to time
zone, "Warning conversion to timestamp without time zone loses information,
consider using timestamp with time zone".

This would basically force users of timestamps to use localtimestamp and not
current_timestamp to avoid the warnings.

--
greg

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Smith 2003-02-19 18:19:32 Removing spaces
Previous Message Peter Childs 2003-02-19 17:39:23 Re: Table Partitioning in Postgres: