Re: [GENERAL] UPDATE using query; per-row function calling problem

2011-09-06 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Rory Campbell-Lange Sent: Monday, September 05, 2011 4:55 PM To: David Johnston Cc: Tom Lane; pgsql-general@postgresql.org Subject: Re: [GENERAL] UPDATE using query; per-row

Re: [GENERAL] UPDATE using query; per-row function calling problem

2011-09-05 Thread Rory Campbell-Lange
On 02/09/11, David Johnston (pol...@yahoo.com) wrote: In my -1 example, am I right in assuming that I created a correlated subquery rather than an correlated one? I'm confused about the difference. Correlated: has a where clause that references the outer query Un-correlated: not

Re: [GENERAL] UPDATE using query; per-row function calling problem

2011-09-02 Thread Rory Campbell-Lange
On 02/09/11, Tom Lane (t...@sss.pgh.pa.us) wrote: Rory Campbell-Lange r...@campbell-lange.net writes: I'm doing an UPDATE something like this: UPDATE slots SET a = 'a' ,b = (SELECT uuid_generate_v1()) WHERE c = TRUE; Each updated row

Re: [GENERAL] UPDATE using query; per-row function calling problem

2011-09-02 Thread David Johnston
In my -1 example, am I right in assuming that I created a correlated subquery rather than an correlated one? I'm confused about the difference. Correlated: has a where clause that references the outer query Un-correlated: not correlated Because of the where clause a correlated

Re: [GENERAL] UPDATE using query; per-row function calling problem

2011-09-02 Thread pasman pasmaƄski
That's interpretation of subselect is ok, when it contains only stable functions. Maybe add a warning when subselect contains volatile function. 2011/9/2, Rory Campbell-Lange r...@campbell-lange.net: On 02/09/11, Tom Lane (t...@sss.pgh.pa.us) wrote: Rory Campbell-Lange r...@campbell-lange.net

Re: [GENERAL] UPDATE using query; per-row function calling problem

2011-09-02 Thread Tom Lane
=?ISO-8859-2?Q?pasman_pasma=F1ski?= pasma...@gmail.com writes: That's interpretation of subselect is ok, when it contains only stable functions. Maybe add a warning when subselect contains volatile function. We're not likely to do that, because this sort of notation is actually fairly

[GENERAL] UPDATE using query; per-row function calling problem

2011-09-01 Thread Rory Campbell-Lange
I'm doing an UPDATE something like this: UPDATE slots SET a = 'a' ,b = (SELECT uuid_generate_v1()) WHERE c = TRUE; Each updated row in slots is getting the same value for b. Is there a way of getting a per-row value from uuid_generate_v1() without

Re: [GENERAL] UPDATE using query; per-row function calling problem

2011-09-01 Thread Tom Lane
Rory Campbell-Lange r...@campbell-lange.net writes: I'm doing an UPDATE something like this: UPDATE slots SET a = 'a' ,b = (SELECT uuid_generate_v1()) WHERE c = TRUE; Each updated row in slots is getting the same value for b. That's Postgres'