Re: How to use read uncommitted transaction level and set update order

From: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
To: Christophe Pettus <xof(at)thebuild(dot)com>
Cc: Andrus <kobruleht2(at)hot(dot)ee>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to use read uncommitted transaction level and set update order
Date: 2009-12-28 15:38:41
Message-ID: 3073cc9b0912280738s45512326p5ce21a097776a855@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Dec 19, 2009 at 7:16 PM, Christophe Pettus <xof(at)thebuild(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Israel Brewster 2009-12-28 16:58:38 Re: cross-database time extract?
Previous Message Tom Lane 2009-12-28 15:19:37 Re: Why grantor is owner in this case?