pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sad@bankir.ru
To: Robins Tharakan <tharakan@gmail.com>
Cc: Jyoti Seth <jyotiseth2001@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Multiple postgresql functions in a single transaction
Date: Wed, 6 Feb 2008 10:42:13 +0300
Message-ID: <1202283733237170500@bankir.ru> (raw)
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>

Robins Tharakan  wrote:
> > It can be done, but it depends on how you are generating the value in the
> > 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 <jyotiseth2001@gmail.com>
> > 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 function
> > 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
> >
> >




view thread (4+ messages)

Message-ID: <1202283733237170500@bankir.ru>
Permalink:  ../1202283733237170500@bankir.ru/
Also on:    postgresql.org/message-id/1202283733237170500@bankir.ru

 · 

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: sad@bankir.ru, tharakan@gmail.com, jyotiseth2001@gmail.com
  Subject: Re: Multiple postgresql functions in a single transaction
  In-Reply-To: <1202283733237170500@bankir.ru>

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

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