Re: [SQL] commit inside a function failing

From: "ktm(at)rice(dot)edu" <ktm(at)rice(dot)edu>
To: Suresh Raja <suresh(dot)rajaabc(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] commit inside a function failing
Date: 2015-01-23 20:06:57
Message-ID: 20150123200657.GZ5510@aart.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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. You would need to use
something like db_link.

Regards,
Ken

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Al Eridani 2015-01-23 20:08:09 PostgreSQL server does not notice that clients have disappeared
Previous Message Adrian Klaver 2015-01-23 20:04:17 Re: commit inside a function failing

Browse pgsql-sql by date

  From Date Subject
Next Message Jason Aleski 2015-01-23 22:58:51 Better way to compute moving averages?
Previous Message Adrian Klaver 2015-01-23 20:04:17 Re: commit inside a function failing