Re: Patch: AdjustIntervalForTypmod shouldn't discard high-order data

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Patch: AdjustIntervalForTypmod shouldn't discard high-order data
Дата
Msg-id 28694.1243901047@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Patch: AdjustIntervalForTypmod shouldn't discard high-order data  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Patch: AdjustIntervalForTypmod shouldn't discard high-order data  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
I wrote:
> Sam Mason <sam@samason.me.uk> writes:
>> On Sun, May 31, 2009 at 06:32:53PM -0400, Tom Lane wrote:
>>> There is some case to be made that we should throw error here,
>>> which we could do by putting error tests where the attached patch
>>> has comments suggesting an error test.

>> With things as they are I think it would be useful to throw an error
>> here; if the user means 25 hours they should say 25 hours!

> Well, maybe, but I'm not really convinced.

I've gone ahead and committed the patch as-is, without the error tests.
There's still time to change it if anyone has a killer argument, but
I thought of another issue that would have to be dealt with: consider
values such as INTERVAL '13' MONTH.  Since per spec we should not
reduce this to 1 month, what is going to happen barring significant
redesign on the output side is that the value will print out as
'1 year 1 month'.  If we were to consider that as illegal input for
INTERVAL MONTH then we'd be creating a situation where valid data
fails to dump and reload.  This won't happen for all cases (eg 60
days doesn't overflow into months) but it shows the danger of throwing
error for cases that we can't clearly distinguish on both input and
output.  So I think we should be satisfied for now with accepting
inputs that are valid per spec, and not worry too much about whether
we are rejecting all values that are a bit outside spec.
        regards, tom lane


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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: User-facing aspects of serializable transactions
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: User-facing aspects of serializable transactions