Re: Default to TIMESTAMP WITH TIME ZONE?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Default to TIMESTAMP WITH TIME ZONE?
Дата
Msg-id 4094227.1628795267@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Default to TIMESTAMP WITH TIME ZONE?  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Default to TIMESTAMP WITH TIME ZONE?  (Simon Riggs <simon.riggs@enterprisedb.com>)
Список pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> On Thu, Aug 12, 2021 at 07:24:58PM +0100, Simon Riggs wrote:
>> I heard the moan about "Why doesn't TIMESTAMP mean TIMESTAMP WITH TIME
>> ZONE" again today, so here is something concrete to address that.
>> 
>> AFAIK, SQL Standard requires the default to be WITHOUT TIME ZONE, but
>> nobody seems to think that is useful.

Standards compliance is useful, no?  If it isn't, there are about 1001
other things nobody much likes about SQL.

>> We even added a specially
>> optimized ALTER TABLE command to make switching from WITHOUT to WITH
>> TIME ZONE easy, so it is clearly an important thing to solve.
>> 
>> So add a parameter called
>> default_timestamp_with_timezone = off (default) | on

> I thought we found that changing behavior via GUC usually ends badly.

Yeah.  Changing from SQL-spec to not-SQL-spec behavior is going to be
one tough sell to begin with, even without the point that that's been
our behavior for over two decades.  But proposing to do it via a GUC
is just not-even-worth-discussing territory.  That would force every
wannabe-portable program to cope with both behaviors; which would
end up meaning that not only do you still have to take care to write
WITH TIME ZONE when you want that, but *also* you'd have to be sure
to write WITHOUT TIME ZONE when you want that.  In short, the worst
of both worlds.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Default to TIMESTAMP WITH TIME ZONE?
Следующее
От: John Naylor
Дата:
Сообщение: Re: badly calculated width of emoji in psql