Re: Old/New

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bob Pawley" <rjpawley(at)shaw(dot)ca>
Cc: "Postgresql" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Old/New
Date: 2010-01-22 19:26:53
Message-ID: 5787.1264188413@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Bob Pawley" <rjpawley(at)shaw(dot)ca> writes:
> I haven't found any documentation on how the underlying structure of
> PostgreSQL actually operates. So I have had to extrapolate.

> I think what you are saying is that on an update of a field the whole row
> which includes that field is affected to the extent that the whole row falls
> under the rules of New/Old.

In triggers, NEW and OLD are just rowtype variables that contain the
entire new and old versions of whatever row the ON UPDATE trigger was
fired for. You do not have to look into the table to find out anything
else about the update event, and doing so is generally a bad idea
because it'll be much slower than just looking at NEW/OLD.

You might be confusing this with the use of NEW/OLD in rules, where they
have a rather different meaning.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Neill 2010-01-22 19:27:27 Re: Fragmentation/Vacuum, Analyze, Re-Index
Previous Message Bob Pawley 2010-01-22 19:20:40 Re: Old/New