From: Martijn van Oosterhout <kleptog@svana.org>
To: Chad Showalter <cshowalter@bplglobal.net>
Cc: Robins Tharakan <tharakan@gmail.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [SQL] rule for update view that updates/inserts into 2 tables
Date: Tue, 15 Apr 2008 17:41:07 +0200
Message-ID: <20080415154107.GE7024@svana.org> (raw)
In-Reply-To: <00a901c89f0d$306d7490$91485db0$@net>
References: <001501c89e4f$3be75340$b3b5f9c0$@net>
<36af4bed0804141733t14d01791t1b7499ed3b986484@mail.gmail.com>
<00a901c89f0d$306d7490$91485db0$@net>
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.
Attachments:
signature.asc (application/pgp-signature, 188B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: kleptog@svana.org, cshowalter@bplglobal.net, tharakan@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [SQL] rule for update view that updates/inserts into 2 tables
In-Reply-To: <20080415154107.GE7024@svana.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox