Re: [HACKERS] LATERAL and VOLATILE functions

2012-12-15 Thread Pavel Stehule
2012/12/15 Tom Lane : > Pavel Stehule writes: >> Is this behave expected? > >> -- unexpected >> postgres=# select * from generate_series(1,3) g(v), LATERAL (SELECT >> random()) x; >> ; >> vrandom >> ---+-- >> 1 0.63025646051392 >> 2 0.63025646051392 >> 3 0.630256

Re: [HACKERS] LATERAL and VOLATILE functions

2012-12-15 Thread Tom Lane
Pavel Stehule writes: > Is this behave expected? > -- unexpected > postgres=# select * from generate_series(1,3) g(v), LATERAL (SELECT random()) > x; > ; > vrandom > ---+-- > 1 0.63025646051392 > 2 0.63025646051392 > 3 0.63025646051392 > (3 rows) The LATERAL ke

[HACKERS] LATERAL and VOLATILE functions

2012-12-15 Thread Pavel Stehule
Hello I tested some usage of LATERAL clause, and I found so LATERAL doesn't respects difference between VOLATILE and IMMUTABLE functions. Is this behave expected? -- unexpected postgres=# select * from generate_series(1,3) g(v), LATERAL (SELECT random()) x; ; v │ random ───┼───