agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: ktm@rice.edu <ktm@rice.edu>
To: Suresh Raja <suresh.rajaabc@gmail.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] commit inside a function failing
Date: Fri, 23 Jan 2015 14:06:57 -0600
Message-ID: <20150123200657.GZ5510@aart.rice.edu> (raw)
In-Reply-To: <CAJP7dtA41j212Q48eRGoJa6_yb6YnRXj_kEth=N-0cPOgWe8fQ@mail.gmail.com>
References: <CAJP7dtA41j212Q48eRGoJa6_yb6YnRXj_kEth=N-0cPOgWe8fQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

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


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (5+ messages)  latest in thread

Message-ID: <20150123200657.GZ5510@aart.rice.edu>
Permalink:  ../20150123200657.GZ5510@aart.rice.edu/
Also on:    postgresql.org/message-id/20150123200657.GZ5510@aart.rice.edu

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ktm@rice.edu, suresh.rajaabc@gmail.com, pgsql-general@postgresql.org
  Subject: Re: [SQL] commit inside a function failing
  In-Reply-To: <20150123200657.GZ5510@aart.rice.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox