pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Brian Blaha <bblaha@umr.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: SQL function triggers
Date: Tue, 15 Oct 2002 10:07:14 -0400
Message-ID: <14677.1034690834@sss.pgh.pa.us> (raw)
In-Reply-To: <3DABB04B.8000104@umr.edu>
References: <3DABB04B.8000104@umr.edu>

Brian Blaha <bblaha@umr.edu> writes:
> I would like to write a function as a set of SQL statements, and then 
> use that function
> in a trigger. However, since triggers require a return type of opaque, 
> and SQL functions
> cannot return type opaque, this doesn't look possible.

You could call a SQL function from a trigger, but it can't be a trigger
itself; at present triggers have to be in C, plpgsql, or pltcl (maybe
plpython?  Not sure about that one).

For what you are doing (transferring info from one table to another)
I suspect a rule might work better than a trigger anyway.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <14677.1034690834@sss.pgh.pa.us>
Permalink:  ../14677.1034690834@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14677.1034690834@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bblaha@umr.edu
  Subject: Re: SQL function triggers
  In-Reply-To: <14677.1034690834@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