Re: How to use read uncommitted transaction level and set update order - Mailing list pgsql-general

From Jaime Casanova
Subject Re: How to use read uncommitted transaction level and set update order
Date
Msg-id 3073cc9b0912280738s45512326p5ce21a097776a855@mail.gmail.com
Whole thread Raw
In response to Re: How to use read uncommitted transaction level and set update order  (Christophe Pettus <xof@thebuild.com>)
List pgsql-general
On Sat, Dec 19, 2009 at 7:16 PM, Christophe Pettus <xof@thebuild.com> wrote:
>
>> I understand that it is not possible to read previous rows without
>> creating hack using triggers.
>
> As noted above, that's not correct.  You cannot access new values of a
> particular row within a single UPDATE statement, but you do see new values
> done in the same transaction.
>

what´s the problem with something as simple as:

create function keep_a_in_b_test1() returns trigger as $$
begin
   new.b = old.a;
   return new;
end;
$$ language plpgsql;

create trigger trg_keep_a_in_b_test1 before update
on test1 for each row execute procedure keep_a_in_b_test1();

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why grantor is owner in this case?
Next
From: Israel Brewster
Date:
Subject: Re: cross-database time extract?