Search Postgresql Archives

Re: Why can't I put a BEFORE EACH ROW trigger on a view?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Karl O. Pinc" <kop@xxxxxxxx> writes:
> On 02/24/2007 07:48:58 PM, Tom Lane wrote:
>> However, I'm not sure that the idea scales to cover updates and
>> deletes; with no concept of physical tuple identity (ctid) for the
>> view rows, it's not clear that you can write triggers that will
>> reliably do the right things

> How is it that the rules can come up with NEW and OLD for a view and
> why wouldn't something be able to give triggers the same data.

NEW and OLD only include the user-visible columns.  I'm not sure that
that's sufficient.  If you assume that the view exposes a primary key
for each of its underlying tables, then you could use the pkey values
to find and update a row in the underlying table(s), but this is not
exactly guaranteeing that you're updating the same row that the view
query saw initially.  And what if you don't want the view to expose
the pkey?

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux