Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs

Поиск
Список
Период
Сортировка
От Atri Sharma
Тема Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Дата
Msg-id CAOeZViccEW9RQYzVpyre941_Td3fvvAJZjuYdNf6MdiQ_mtaSw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Ответы Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Список pgsql-hackers


On Tue, Jan 6, 2015 at 12:43 PM, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
On 06-01-2015 PM 04:08, Atri Sharma wrote:
> On Tue, Jan 6, 2015 at 12:29 PM, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp


I read what Ashutosh says as that a clause like IMMUTABLE does not
entail a node execution. Reading manual for CREATE FUNCTION:

<manual>
IMMUTABLE
STABLE
VOLATILE

These attributes inform the query optimizer about the behavior of the
function.
</manual>

They declare the shape of the kind of output the function produces and
planner simply trusts the declaration meaning it does not add a node to
check if, say, an IMMUTABLE function did not actually modify the
database or that it is returning the same output for a given input.

Though, I have no strong opinion on whether one thing is good or the
other or whether they cover some particular use case all the same.
Perhaps you can say that better.


Personally, I think returning non ordered rows when ORDER BY clause is specifically specified by user is a gross violation of security and could lead to major user application breakdowns, since the application will trust that postgres will return the rows in order since ORDER BY was specified. Of course, what Ashutosh suggested makes the patch much simpler, but I would rather not go down that road. 



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

Предыдущее
От: Atri Sharma
Дата:
Сообщение: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Следующее
От: David G Johnston
Дата:
Сообщение: Re: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs