Re: trigger troubles

From: James Gregory <james(at)anchor(dot)net(dot)au>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: PostgreSQL general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: trigger troubles
Date: 2003-03-20 15:19:06
Message-ID: 1048173546.8571.6.camel@pirate.bridge.anchor.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2003-03-20 at 04:10, Stephan Szabo wrote:
> On 20 Mar 2003, James Gregory wrote:
>
> > Why does this not work? It's a plpython function if that changes
> > anything
> >
> > perversity=# \df for*
> > List of functions
> > Result data type | Schema | Name | Argument data types
> > ------------------+------------+-------------------+---------------------
> > text | pg_catalog | format_type | oid, integer
> > "trigger" | public | foreign_key_check | text
> > (2 rows)
> >
> > perversity=# create trigger f_foreign_key_check before insert or update
> > on f for each row execute procedure foreign_key_check ('f');
> > ERROR: CreateTrigger: function foreign_key_check() does not exist
>
> Trigger functions should be created to return trigger and take no
> arguments. The arguments from create trigger are generally passed in
> a different way (although I don't know what that is for plpython)

It would be sufficient to get the table name from within the python code
somehow, but I couldn't find a way to do this.

From

http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=plpython-trigger.html

and

http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=sql-createtrigger.html

it looks very much like I am using the correct syntax. Is this a bug? Is
there a work around? Currently the only thing I can think of is to
encode the table name in the trigger name, since plpython claims to be
able to get at that.

Does this sort of thing work in CVS?

James.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-03-20 15:26:58 Re: log_timestamp and SIGHUP?
Previous Message Kurt Overberg 2003-03-20 15:15:03 Re: Big insert/delete memory problems