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

From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Date: 2015-01-06 07:26:45
Message-ID: CAOeZViccEW9RQYzVpyre941_Td3fvvAJZjuYdNf6MdiQ_mtaSw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 6, 2015 at 12:43 PM, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)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(at)lab(dot)ntt(dot)co(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G Johnston 2015-01-06 07:31:24 Re: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Previous Message Atri Sharma 2015-01-06 07:23:59 Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs