pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Multiple postgresql functions in a single transaction
4+ messages / 3 participants
[nested] [flat]

* Multiple postgresql functions in a single transaction
@ 2008-02-06 06:21  Jyoti Seth <jyotiseth2001@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Jyoti Seth @ 2008-02-06 06:21 UTC (permalink / raw)
  To: pgsql-sql

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








^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Multiple postgresql functions in a single transaction
@ 2008-02-06 07:23  Robins Tharakan <tharakan@gmail.com>
  parent: Jyoti Seth <jyotiseth2001@gmail.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Robins Tharakan @ 2008-02-06 07:23 UTC (permalink / raw)
  To: Jyoti Seth <jyotiseth2001@gmail.com>; +Cc: pgsql-sql

> 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.
>
> *Robins*
>
>
> ---------- 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
>
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Multiple postgresql functions in a single transaction
@ 2008-02-06 07:37  Jyoti Seth <jyotiseth2001@gmail.com>
  parent: Robins Tharakan <tharakan@gmail.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Jyoti Seth @ 2008-02-06 07:37 UTC (permalink / raw)
  To: 'Robins Tharakan' <tharakan@gmail.com>; +Cc: pgsql-sql

Thanks. I am not using sequences. I tried an example and it worked.

 

From: Robins Tharakan [mailto:tharakan@gmail.com] 
Sent: Wednesday, February 06, 2008 12:54 PM
To: Jyoti Seth
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Multiple postgresql functions in a single transaction

 

 

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.

Robins

 

---------- 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

 

 

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Multiple postgresql functions in a single transaction
@ 2008-02-06 07:42  sad@bankir.ru
  parent: Robins Tharakan <tharakan@gmail.com>
  1 sibling, 0 replies; 4+ messages in thread

From: sad@bankir.ru @ 2008-02-06 07:42 UTC (permalink / raw)
  To: Robins Tharakan <tharakan@gmail.com>; +Cc: Jyoti Seth <jyotiseth2001@gmail.com>; 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@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
> >
> >




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2008-02-06 07:42 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-02-06 06:21 Multiple postgresql functions in a single transaction Jyoti Seth <jyotiseth2001@gmail.com>
2008-02-06 07:23 ` Robins Tharakan <tharakan@gmail.com>
2008-02-06 07:37   ` Jyoti Seth <jyotiseth2001@gmail.com>
2008-02-06 07:42   ` sad@bankir.ru

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