[PLPGSQL] PERFORM into an EXECUTE allowed ? - Mailing list pgsql-general

From Bruno Baguette
Subject [PLPGSQL] PERFORM into an EXECUTE allowed ?
Date
Msg-id 490537D7.8040508@gmail.com
Whole thread Raw
Responses Re: [PLPGSQL] PERFORM into an EXECUTE allowed ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.baguette@gmail.com


pgsql-general by date:

Previous
From: Martin Gainty
Date:
Subject: Re: again... (win32 logging errors)
Next
From: Tom Lane
Date:
Subject: Re: [PLPGSQL] PERFORM into an EXECUTE allowed ?