Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs - Mailing list pgsql-hackers

From Atri Sharma
Subject Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Date
Msg-id CAOeZViedopQmDMukk2jXqZLVqTQg83+HnvuDcdQO6iTx1oPEfA@mail.gmail.com
Whole thread Raw
In response to Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
List pgsql-hackers


On Tue, Jan 6, 2015 at 12:30 PM, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> wrote:


On Tue, Jan 6, 2015 at 12:23 PM, Atri Sharma <atri.jiit@gmail.com> wrote:



Even checking whether the output of the function is in the right order or not, has its cost. I am suggesting that we can eliminate this cost as well. For example, PostgreSQL does not check whether a function is really immutable or not.
 

That implies possibly returning a non ordered result set even when the user explicitly specified an ORDER BY clause. If we are depending on an optimization and it did not work out (even if it is a user error), I think we should error out indicating that the order was incorrect rather than returning non ordered rows, which could be disastrous IMO. 

pgsql-hackers by date:

Previous
From: Atri Sharma
Date:
Subject: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Next
From: Peter Geoghegan
Date:
Subject: Re: Problems with approach #2 to value locking (INSERT ... ON CONFLICT UPDATE/IGNORE patch)