UPDATE using query; per-row function calling problem

From: Rory Campbell-Lange <rory(at)campbell-lange(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: UPDATE using query; per-row function calling problem
Date: 2011-09-01 22:09:03
Message-ID: 20110901220903.GA22775@campbell-lange.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 doing a
PL loop?

Regards
Rory

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2011-09-01 22:58:10 Re: Why schema of table is removed from explain?
Previous Message Raghavendra 2011-09-01 22:04:47 pgfoundry.org is not accessible