Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YEkVm-0005JP-9d for pgsql-general@arkaria.postgresql.org; Fri, 23 Jan 2015 20:07:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YEkVl-0001c2-Bn for pgsql-general@arkaria.postgresql.org; Fri, 23 Jan 2015 20:07:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YEkVW-0001E0-C6; Fri, 23 Jan 2015 20:07:06 +0000 Received: from proofpoint1.mail.rice.edu ([128.42.201.100] helo=pp1.rice.edu) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YEkVQ-0004im-2B; Fri, 23 Jan 2015 20:07:01 +0000 Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id t0NK6lPi020568; Fri, 23 Jan 2015 14:06:57 -0600 Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by pp1.rice.edu with ESMTP id 1s27jrhv1x-1; Fri, 23 Jan 2015 14:06:57 -0600 X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel X-SMTP-Auth: no X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.rice.edu (aart.rice.edu [168.7.56.48]) by mh2.mail.rice.edu (Postfix) with ESMTP id 7AA60500116; Fri, 23 Jan 2015 14:06:57 -0600 (CST) Received: by aart.rice.edu (Postfix, from userid 18612) id 7154B1007A8; Fri, 23 Jan 2015 14:06:57 -0600 (CST) Date: Fri, 23 Jan 2015 14:06:57 -0600 From: "ktm@rice.edu" To: Suresh Raja Cc: pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SQL] commit inside a function failing Message-ID: <20150123200657.GZ5510@aart.rice.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1501230186 X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org 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