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

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Дата
Msg-id 87vfzg17fx.fsf@stark.dyndns.tv
обсуждение исходный текст
Ответ на Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Список 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 по дате отправления:

Предыдущее
От: Peter Childs
Дата:
Сообщение: Re: Table Partitioning in Postgres:
Следующее
От: Dave Smith
Дата:
Сообщение: Removing spaces