Re: rule calls function, passing OLD

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: "R(dot)Welz" <linuxprodukte(at)gmx(dot)de>
Cc: Postgesql list <pgsql-novice(at)postgresql(dot)org>
Subject: Re: rule calls function, passing OLD
Date: 2004-07-14 14:26:17
Message-ID: 20040714072120.M95638@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


On Wed, 14 Jul 2004, R.Welz wrote:

> test=# \i '/home/myAccount/Documents/Datenbank Layout/Postgres
> Sytax/test/Regeln2'
> CREATE FUNCTION
> psql:/home/myAccount/Documents/Datenbank Layout/Postgres
> Sytax/test/Regeln2:16: ERROR: function
> deny_namen_telefonverweise(namen_telefonverweise) does not exist
> HINT: No function matches the given name and argument types. You may
> need to add explicit type casts.

I'd think you'd want the function declared as above (using the specific
rowtype), not as one taking record, which appears to work for me.

> CREATE OR REPLACE FUNCTION deny_namen_telefonverweise(record) RETURNS
> void AS '
> DECLARE
> result RECORD;
>
> BEGIN
> /* DELETE ROW LATER */
> SELECT 1+1;
>
> END;
> '
> LANGUAGE 'plpgsql';
>
>
> CREATE OR REPLACE RULE deny_namen_Telefonverweise AS ON DELETE TO
> Namen_Telefonverweise
> DO INSTEAD
> SELECT DENY_Namen_Telefonverweise(OLD);

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-07-14 14:29:10 Re: rule calls function, passing OLD
Previous Message R.Welz 2004-07-14 13:00:57 rule calls function, passing OLD