Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice... - Mailing list pgsql-general

From Greg Stark
Subject Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Date
Msg-id 87vfzg17fx.fsf@stark.dyndns.tv
Whole thread Raw
In response to Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...  (Andrew Sullivan <andrew@libertyrms.info>)
List pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Greg Stark <gsstark@mit.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

pgsql-general by date:

Previous
From: Peter Childs
Date:
Subject: Re: Table Partitioning in Postgres:
Next
From: Dave Smith
Date:
Subject: Removing spaces