Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 72B912E3F2E for ; Wed, 6 Feb 2008 03:42:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 48956-05 for ; Wed, 6 Feb 2008 03:42:25 -0400 (AST) Received: from moon.antora.ru (moon.antora.ru [217.107.222.210]) by postgresql.org (Postfix) with ESMTP id 274722E3F65 for ; Wed, 6 Feb 2008 03:42:15 -0400 (AST) Envelope-to: pgsql-sql@postgresql.org Received: from [127.0.0.1] (helo=moon) by moon.antora.ru with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JMev7-0001tI-CH for pgsql-sql@postgresql.org; Wed, 06 Feb 2008 10:42:13 +0300 Received: from [212.176.226.89] by bankir.ru via HTTP; Wed, 6 Feb 2008 10:42:13 +0300 From: Date: Wed, 6 Feb 2008 10:42:13 +0300 X-Mailer: Axigen WebMail To: Robins Tharakan Cc: Jyoti Seth , pgsql-sql@postgresql.org Message-ID: <1202283733237170500@bankir.ru> In-Reply-To: <36af4bed0802052323l70d7cbb7y10aeafe2467dd3c6@mail.gmail.com> References: <47A8B788.6010304@gmail.com> <87d4rbm3is.fsf@ttmail.com> <000c01c86888$79a497d0$6cedc770$@com> <36af4bed0802052323i6b842b2ej67ef986fb2532045@mail.gmail.com> <36af4bed0802052323l70d7cbb7y10aeafe2467dd3c6@mail.gmail.com> Subject: Re: Multiple postgresql functions in a single transaction MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.13 tagged_above=0 required=5 tests=AWL=-1.645, BAYES_40=-0.185, RCVD_IN_BL_SPAMCOP_NET=1.96 X-Spam-Level: X-Archive-Number: 200802/30 X-Sequence-Number: 30121 Robins Tharakan wrote: > > It can be done, but it depends on how you are generating the value in t= he > > first function. > > If you sequences though you may have to take care of reverting it > > yourself. Sequences had been constructed in this manner not to cause pain for users -= - think of it. So i advise to avoid reverting sequences ANYWAY. Even if you think that this would not cause a problem. > > ---------- Forwarded message ---------- > > From: Jyoti Seth > > Date: Feb 6, 2008 11:51 AM > > Subject: [SQL] Multiple postgresql functions in a single transaction > > To: pgsql-sql@postgresql.org > > > > > > Hi, > > > > I have two postgresql functions. One function is calling another functi= on > > for certain value. I want that these two functions work under single > > transaction so that even if the value gets generated in the second > > function > > and the first function that calls the second function fails. Then the > > value > > generated in the second function should also roll back. > > > > Please let me know if we can execute two functions of postgresql in a > > single > > transaction. > > > > Thanks, > > Jyoti Seth > > > > > > > > > > > > > > ---------------------------(end of broadcast)--------------------------= - > > TIP 5: don't forget to increase your free space map settings > > > >