Re: Multiple postgresql functions in a single transaction

From: <sad(at)bankir(dot)ru>
To: Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: Jyoti Seth <jyotiseth2001(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Multiple postgresql functions in a single transaction
Date: 2008-02-06 07:42:13
Message-ID: 1202283733237170500@bankir.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)gmail(dot)com>
> > Date: Feb 6, 2008 11:51 AM
> > Subject: [SQL] Multiple postgresql functions in a single transaction
> > To: pgsql-sql(at)postgresql(dot)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
> >
> >

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sabin Coanda 2008-02-06 13:36:26 undefined relations in pg_locks
Previous Message Jyoti Seth 2008-02-06 07:37:23 Re: Multiple postgresql functions in a single transaction