Thread: SP in PostgreSQL

SP in PostgreSQL

From
Ashish Karalkar
Date:
Hello All,
I am using PostgreSQL 8.2.

I am having 2 SP's ,second one is called from the
first one. is there any solution to commit the updates
done by the second SP only??

when I wrote commit inside second SP it gives me
following error

ERROR: SPI_execute_plan failed executing query
"commit": SPI_ERROR_TRANSACTION



Thanks in advance!!!

With Regards
Ashish Karalkar

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Re: SP in PostgreSQL

From
"A. Kretschmer"
Date:
am  Wed, dem 10.01.2007, um  6:01:41 -0800 mailte Ashish Karalkar folgendes:
> Hello All,
> I am using PostgreSQL 8.2.
>
> I am having 2 SP's ,second one is called from the
> first one. is there any solution to commit the updates
> done by the second SP only??

No, you can't. A function is a transction, you can't do a commit inside.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

Re: SP in PostgreSQL

From
"Joshua D. Drake"
Date:
On Wed, 2007-01-10 at 06:01 -0800, Ashish Karalkar wrote:
> Hello All,
> I am using PostgreSQL 8.2.
>
> I am having 2 SP's ,second one is called from the
> first one. is there any solution to commit the updates
> done by the second SP only??
>
> when I wrote commit inside second SP it gives me
> following error
>
> ERROR: SPI_execute_plan failed executing query
> "commit": SPI_ERROR_TRANSACTION

SP/Functions are automatically performed in a transaction.

Joshua D. Drake

>
>
>
> Thanks in advance!!!
>
> With Regards
> Ashish Karalkar
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
--

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate