Re: how to make an SQL UPDATE from record returning function - Mailing list pgsql-general

From Rafal Pietrak
Subject Re: how to make an SQL UPDATE from record returning function
Date
Msg-id 1335260238.27563.71.camel@localhost.localdomain
Whole thread Raw
In response to Re: how to make an SQL UPDATE from record returning function  (Abel Abraham Camarillo Ojeda <acamari@the00z.org>)
List pgsql-general
On Tue, 2012-04-24 at 02:48 -0500, Abel Abraham Camarillo Ojeda wrote:
[----------------]
>
> Why don't create table my_table which stores the composite value by itself (not
>     in two parts)?

Hmmm. OK. mea coulpa. I didn't follow the SQL good practice, and I don't
have a unique ID column in the updated table. So, I cannot "cook
updates" in temporary store (a table), and then post them against
relevant rows.

The function computes updated values for each row (and is expensive),
and I have the particular row "pinpointed" only within the UPDATE
transaction.

And btw: the updated table is "kind of big", and only selected rows are
updated at a time. The selected subset is a tiny fraction of the whole
table, and only because of fine-tuning that sellection, the update keeps
pace with the growth of the table.

So, as of now, temporary storage in additional table want work for me.
thus I'm still looking for a solution.

-R


pgsql-general by date:

Previous
From: Krzysztof Nienartowicz
Date:
Subject: Re: [HACKERS] Namespace of array of user defined types is confused by the parser in insert?
Next
From: Thomas Kellerer
Date:
Subject: Re: how to make an SQL UPDATE from record returning function