Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA16203; Tue, 8 Sep 92 10:46:09 -0700
Date: Tue, 8 Sep 92 10:46:09 -0700
Message-Id: <9209081746.AA16203@postgres.Berkeley.EDU>
From: Lance Gatrell (303) 977-2052 <gatrell@saturn.den.mmc.com>
Subject: "C" function called on append
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu

I want to define a rule that will call a "C" function whenever a tuple
is APPENDed to a table.

For example, I've define a function with the following:
	define function ProcessSubs2 (language = "c", returntype = int4)
	arg is (image) as "....pathname to function"

This function works when I call it directly, ie:
	retrieve (image.ProcessSubs2)

I then tried to define the following rules, but neither will call the "C"
function:
	define rule ProcessSubs2 is on append to image do replace new(nSubs
	= ProcessSubs2(new))

	define rule ProcessSubs2 is on append to image do retrieve 
	(image.ProcessSubs2) where image.oid = new.oid

	define rule example1 is on append to image do retrieve
	(image.ProcessSubs2) where image.oid = new.oid

The result is either that I hang the monitor process, or I get the warning
"WARN: date & time View Rules must not have parameters"!

We're running Postgres 4.0.

Is it possible to have a "C" function called in a defined rule?

Thanks,

Lance B. Gatrell
gatrell@saturn.den.mmc.com
