pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Grant Kaufmann <grant@intekom.com>
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] Adding a rule to update a last_changed field
Date: Fri, 22 Oct 1999 12:09:54 -0400
Message-ID: <19991022120954.B5228@intekom.com> (raw)


> > I'm trying to use a rule to maintain a last_changed field. 
> 
> Use a trigger, not a rule.  You can adjust the last_changed
> field before the tuple is stored that way.  There's an example
> in the manual's discussion of triggers.

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.

And from the manual:
  "The procedure name is the C function called"

If triggers can use SQL, I'd be happy to use them, but I can't find a single
example or description on how to do this.




view thread (7+ messages)  latest in thread

Message-ID: <19991022120954.B5228@intekom.com>
Permalink:  ../19991022120954.B5228@intekom.com/
Also on:    postgresql.org/message-id/19991022120954.B5228@intekom.com

 · 

reply

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: grant@intekom.com
  Subject: Re: [SQL] Adding a rule to update a last_changed field
  In-Reply-To: <19991022120954.B5228@intekom.com>
  References: <19991022120954.B5228@intekom.com>

* 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