Re: My function run successfully with cursor, but can't change table

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: My function run successfully with cursor, but can't change table
Date: 2013-06-10 16:42:35
Message-ID: kp4vll$lis$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Kevin Grittner wrote on 10.06.2013 15:19:
> It has nothing to do with the way you are using the cursor; your
> problem is that you are causing an error by attempting to COMMIT
> inside a function (which is not allowed). This rolls back the
> subtransaction defined by the BEGIN/EXCEPTION block. You then
> suppress any display of the error with the WHEN OTHERS block.

I thought you could *never* use commit (or rollback) inside a function?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2013-06-10 16:48:38 Re: My function run successfully with cursor, but can't change table
Previous Message Gustavo Amarilla Santacruz 2013-06-10 16:02:39 Re: Postgresql - Currval Vs Session Pool