Search Postgresql Archives

Re: Coalesce bug ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Dec 22, 2012 at 2:25 AM, David Johnston <polobo@xxxxxxxxx> wrote:
> You have defined the function as "IMMUTABLE".  The system is allowed to cache the results of a given call (i.e. "ps3(2)") and return the value without actually executing the function ("never executed").  Your second example returns "1" without a warning regarding the "2" invocation due to this.  The Query Plan you show also matches this behavior.

Further reading on this subject:

http://www.postgresql.org/docs/9.1/static/xfunc-volatility.html

See particularly the second paragraph after the bullet list.

ChrisA


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux