Re: [GENERAL] [SQL] commit inside a function failing

2015-01-24 Thread Christopher Browne
The straightforward answer is that stored functions always run *inside* the context of a preexisting transaction, therefore you cannot request a separate transaction from within a stored function. What you are asking is fairly deeply impossible.

Re: [GENERAL] [SQL] commit inside a function failing

2015-01-23 Thread k...@rice.edu
On Fri, Jan 23, 2015 at 01:56:53PM -0600, Suresh Raja wrote: > Hi All: > > We are running a function with a loop in it. We tried > commit; > We are getting error with above command. How can i easily commit withing > a function. > > > Thanks, > -SR PostgreSQL functions run within a transaction

Re: [GENERAL] [SQL] commit inside a function failing

2015-01-23 Thread Adrian Klaver
On 01/23/2015 11:56 AM, Suresh Raja wrote: Hi All: We are running a function with a loop in it. We tried commit; We are getting error with above command. How can i easily commit withing a function. Functions do not have transactions inside them. If you are using plpgsql you can use EXCEPTIO

Re: [GENERAL] [SQL] commit inside a function failing

2015-01-23 Thread Pavel Stehule
Hi 2015-01-23 20:56 GMT+01:00 Suresh Raja : > Hi All: > > We are running a function with a loop in it. We tried > commit; > We are getting error with above command. How can i easily commit withing > a function. > > It is not possible in PostgreSQL Regards Pavel Stehule > > Thanks, > -SR >