Re: FETCH FIRST clause PERCENT option

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: FETCH FIRST clause PERCENT option
Дата
Msg-id 11184.1543170668@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: FETCH FIRST clause PERCENT option  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> On 11/25/18 1:05 PM, Vik Fearing wrote:
>> I don't see how this behavior is justified by reading the SQL standard.
>> Obviously only an integer number of rows is going to be returned, but
>> the percentage should be calculated correctly.

> Right. My draft of SQL standard says this:
> 31) The declared type of the <simple value specification> simply
> contained in <fetch first percentage> shall be numeric.

> So the standard pretty much requires treating the value as numeric.

Note that this should not be read as "it must be of the type that PG
calls numeric".  I'd read it as requiring a value that's in the numeric
type hierarchy.  float8 would be a reasonable implementation choice
if we're going to coerce to a specific type.

            regards, tom lane


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Continue work on changes to recovery.conf API
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Updated backup APIs for non-exclusive backups