Hans-Jürgen Schönig <hs@cybertec.at> writes:
> I have a severe problem when working with PL/pgSQL triggers. Somehow the
> problem seems to be strange. Here is the code:
>
> CREATE OR REPLACE FUNCTION checkint () RETURNS opaque AS
> '
> BEGIN
> IF TG_OP = ''DELETE'' THEN
> RAISE NOTICE ''% wert'', TG_ARGV[0];
> DELETE FROM TG_ARGV[0];
You need to construct a query on the fly using EXECUTE, since queries
are preparsed in PL/pgSQL. So it would be:
EXECUTE ''DELETE FROM '' || TG_ARGV[0] ;
-Doug
--
Doug McNaught Wireboard Industries http://www.wireboard.com/
Custom software development, systems and network consulting.
Java PostgreSQL Enhydra Python Zope Perl Apache Linux BSD...