From: Tom Lane <tgl@sss.pgh.pa.us>
To: Grant Kaufmann <grant@intekom.com>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Adding a rule to update a last_changed field
Date: Fri, 22 Oct 1999 14:49:38 -0400
Message-ID: <21283.940618178@sss.pgh.pa.us> (raw)
In-Reply-To: <19991022120954.B5228@intekom.com>
Grant Kaufmann <grant@intekom.com> writes:
> My original choice was to use a trigger, but I don't want to introduce
> C code when I don't have to. I don't believe that making external calls
> should be necessary for a query that can be so simply expressed in SQL.
Who said anything about C code? I was thinking of a pl/pgsql trigger,
actually. The pl/pgsql section of the manual (programmer's guide under
procedural languages) has an example of almost exactly this problem.
If you do want to stick with rules then you'll need to make sure that
the underlying insert is to a different table than the one the insert
rule applies to --- in other words, create a view and have users insert
into the view.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, grant@intekom.com
Subject: Re: [SQL] Adding a rule to update a last_changed field
In-Reply-To: <21283.940618178@sss.pgh.pa.us>
References: <19991022120954.B5228@intekom.com> <21283.940618178@sss.pgh.pa.us>
* 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