Re: Patch for SQL-standard negative valued year-month literals

Поиск
Список
Период
Сортировка
От Stephen R. van den Berg
Тема Re: Patch for SQL-standard negative valued year-month literals
Дата
Msg-id 20080917122911.GA14080@cuci.nl
обсуждение исходный текст
Ответ на Re: Patch for SQL-standard negative valued year-month literals  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Patch for SQL-standard negative valued year-month literals
Список pgsql-hackers
Tom Lane wrote:
>Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
>> Tom Lane wrote:
>> If I read SQL 200N's spec correctly

>>   select interval '-1 1:00:00';

>> should mean        "-1 days -1 hours",
>> yet 8.3 sees it as "-1 days +1 hours".

>I think we are kind of stuck on this one.  If we change it, then how
>would one represent -1 days +1 hours?  The spec's format is only sane
>if you assume all the fields must have the same sign, which is not
>the case for PG.

-1 days +1 hours = interval '-0 23:00:00'

Intervals are a scalar, not an addition of assorted values, alternating signs
between fields would be wrong.
-- 
Sincerely,          Stephen R. van den Berg.

He did a quarter of the work in *half* the time!


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Common Table Expressions (WITH RECURSIVE) patch
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Patch for SQL-standard negative valued year-month literals