[PLPGSQL] PERFORM into an EXECUTE allowed ?

From: Bruno Baguette <bruno(dot)baguette(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: [PLPGSQL] PERFORM into an EXECUTE allowed ?
Date: 2008-10-27 03:39:03
Message-ID: 490537D7.8040508@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello !

I'm trying to build a PL/PGSQL function trigger.

When the function is triggered, PostgreSQL complains about an error at
or near PEFORM.

Here's the piece of code :

EXECUTE 'PERFORM COUNT(*)'
|| ' FROM ' || quote_ident(TG_RELNAME)
|| ' GROUP BY ' || quote_ident(column_name_to_check)
|| ' HAVING COUNT(*) > 1';

The next lines of code don't check for the value (so, PERFORM), but just
do some action IF FOUND. Table and column to check are dynamic and comes
from the trigger, that's why I use EXECUTE.

Is it allowed to do a PERFORM into an EXECUTE ? I didn't see any notes
about such limitation in the doc, but I ask in case of... :-/

Many thanks in advance !

Regards,

--
Bruno Baguette - bruno(dot)baguette(at)gmail(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-10-27 04:16:24 Re: [PLPGSQL] PERFORM into an EXECUTE allowed ?
Previous Message Martin Gainty 2008-10-27 02:28:25 Re: again... (win32 logging errors)