On Thu, 14 Mar 2002, [iso-8859-1] Hans-J�rgen Sch�nig wrote:
> 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];
EXECUTE ''DELETE FROM '' || TG_ARGV[0];
will probably do what you want. You can't directly
substitute variables for tables, columns etc but you
can use execute to run a command string.