Re: [SQL] rule for update view that updates/inserts into 2 tables - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: [SQL] rule for update view that updates/inserts into 2 tables
Date
Msg-id 20080415154107.GE7024@svana.org
Whole thread Raw
In response to Re: [SQL] rule for update view that updates/inserts into 2 tables  ("Chad Showalter" <cshowalter@bplglobal.net>)
List pgsql-hackers
On Tue, Apr 15, 2008 at 11:27:15AM -0400, Chad Showalter wrote:
> I don't need to define the view the way I did in my example.  I do need the
> view to have fields that map to fields in my_audit_table in order to do an
> insert into that table with values from the insert statement.

Right.

> Here's one solution that seems to work.  Change my view to the following,
> leave rules the same as before:

Looks good, though I would've used NULLs instead of actual values, but
it doesn't matter.

The reason I was asking about the SP is that you could do:

SELECT insert_row(a,b,c);

With the appropriate procedure definition and it would still have one
roundtrip. But your way works also.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: stack smashing detected
Next
From: Andrew Chernow
Date:
Subject: Re: pulling libpqtypes from queue