Re: BUG #1517: SQL interval syntax is accepted by the parser,

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #1517: SQL interval syntax is accepted by the parser,
Дата
Msg-id 15892.1111622104@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Roy Badami <roy@gnomon.org.uk>)
Ответы Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Roy Badami <roy@gnomon.org.uk>)
Список pgsql-bugs
Roy Badami <roy@gnomon.org.uk> writes:
>     Tom> Yes.  The ISO design for the datatype is pretty brain-dead if
>     Tom> you ask me --- the basic meaning of a data literal shouldn't
>     Tom> be so dependent on context.

> Arguably it's not, because the interval qualifier is an intrinsic (and
> mandatory) part of the literal syntax, so the full ISO interval is
> completely unambigous.

Well, it's okay *in the context of an interval literal*, where
everything you need to know is right there, even if some of it is inside
the quotes and some isn't.  The problem comes as soon as you consider
external data representations --- if you consider the bit inside the
quotes to be the preferred textual representation, then you have a
situation where you can't interpret the value without context
information that's not directly attached to the data.  This is why I say
it's ambiguous.

As you point out, the ISO spec doesn't actually say that that string
literal has to be the external textual representation ... but it's
surely pretty bizarre that it's not a good candidate to be the textual
representation.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Следующее
От: Roy Badami
Дата:
Сообщение: Re: BUG #1518: Conversions to (undocumented) SQL year-month and