Re: [GENERAL] Scalar subquery

2010-09-01 Thread Vyacheslav Kalinin
Thanks, Tom Can this be clarified in docs? It is stated there now that scalar subquery is one of the kinds of expressions and it is somewhat counter-intuitive that an expression may sometimes not respect its own degree of volatility. On Wed, Sep 1, 2010 at 2:16 AM, Tom Lane t...@sss.pgh.pa.us

Re: [GENERAL] Scalar subquery

2010-08-31 Thread Vyacheslav Kalinin
I just got my hands on mysql (5.0.something) and it does not cache the scalar subquery result. So... now I'm completely puzzled whether this is a bug, a desired result or just a loosely standardized thing. Help anyone? On Fri, Aug 27, 2010 at 5:41 PM, Vyacheslav Kalinin v...@mgcp.com wrote: Hi,

Re: [GENERAL] Scalar subquery

2010-08-31 Thread Tom Lane
Vyacheslav Kalinin v...@mgcp.com writes: I just got my hands on mysql (5.0.something) and it does not cache the scalar subquery result. So... now I'm completely puzzled whether this is a bug, a desired result or just a loosely standardized thing. It's loosely standardized. AFAICS, the spec

[GENERAL] Scalar subquery

2010-08-27 Thread Vyacheslav Kalinin
Hi, Apparently scalar subquery when used as a part of SELECT statement and when it does not depend on outer query columns is executed only once per statement, e.g.: postgres=# select i, (select random()) rand from generate_series(1, 3) i; i | rand ---+--- 1 |