Re: how to make an SQL UPDATE from record returning function

From: Rafal Pietrak <rafal(at)zorro(dot)isa-geek(dot)com>
To: Abel Abraham Camarillo Ojeda <acamari(at)the00z(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to make an SQL UPDATE from record returning function
Date: 2012-04-24 09:37:18
Message-ID: 1335260238.27563.71.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2012-04-24 10:10:32 Re: how to make an SQL UPDATE from record returning function
Previous Message Krzysztof Nienartowicz 2012-04-24 09:12:56 Re: [HACKERS] Namespace of array of user defined types is confused by the parser in insert?