Postgres trigger issue with update statement in it.

Поиск
Список
Период
Сортировка
От Kaleeswaran Velu
Тема Postgres trigger issue with update statement in it.
Дата
Msg-id 1365048506.78628.YahooMailNeo@web163902.mail.gq1.yahoo.com
обсуждение исходный текст
Ответы Re: Postgres trigger issue with update statement in it.  (Wolfe Whalen <wolfe@quios.net>)
Re: Postgres trigger issue with update statement in it.  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-sql

 Hello Friends,
I am new to Postgres DB. Recently installed Postgres 9.2. 
Facing an issue with very simple trigger, tried to resolve myself by reading documents or google search but no luck.

I have a table A(parent) and table B (child). There is a BEFORE INSERT OR UPDATE trigger attached in table B. This trigger has a update statement in it. This update statement should update a respective record in table A when ever there is any insert/update happen in table B.  The issue here is where ever I insert/update record in table B, getting an error as below :

********** Error **********
ERROR: cannot begin/end transactions in PL/pgSQL
SQL state: 0A000
Hint: Use a BEGIN block with an EXCEPTION clause instead.
Context: PL/pgSQL function func_update_payment() line 53 at SQL statement

Line no 53 in the above error message is an update statement. If I comment out the update statement, trigger works fine.

Can anyone shed some lights on this? Your help is appreciated.

Thanks and Regards
Kaleeswaran Velu

В списке pgsql-sql по дате отправления:

Предыдущее
От: James Sharrett
Дата:
Сообщение: Re: how can I replace all instances of a pattern
Следующее
От: Wolfe Whalen
Дата:
Сообщение: Re: Postgres trigger issue with update statement in it.