[PLPGSQL] PERFORM into an EXECUTE allowed ?

Поиск
Список
Период
Сортировка
От Bruno Baguette
Тема [PLPGSQL] PERFORM into an EXECUTE allowed ?
Дата
Msg-id 490537D7.8040508@gmail.com
обсуждение исходный текст
Ответы Re: [PLPGSQL] PERFORM into an EXECUTE allowed ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Martin Gainty
Дата:
Сообщение: Re: again... (win32 logging errors)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PLPGSQL] PERFORM into an EXECUTE allowed ?