BUG #5500: SPI_execute_plan_with_paramlist SPI_ERROR_TRANSACTION with savepoint

From: "Robert Walker" <robwalker01(at)speedymail(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5500: SPI_execute_plan_with_paramlist SPI_ERROR_TRANSACTION with savepoint
Date: 2010-06-11 18:49:03
Message-ID: 201006111849.o5BIn3pc087188@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5500
Logged by: Robert Walker
Email address: robwalker01(at)speedymail(dot)org
PostgreSQL version: 9.0 beta 2
Operating system: Windows XP 32-bit SP2
Description: SPI_execute_plan_with_paramlist SPI_ERROR_TRANSACTION
with savepoint
Details:

SPI_execute_plan_with_paramlist seems to be newly introduced into 9.0 beta
that is causing an error in pl/pgsql when attempting to create a savepoint.
This did not happen when using version 8.4 (which I assume was not using
SPI_execute_plan_with_paramlist), so I believe this is a regression.

The specific format of the error is:

ERROR: SPI_execute_plan_with_paramlist failed executing query "SAVEPOINT
savepoint_name": SPI_ERROR_TRANSACTION
SQL state: XX000
Context: PL/pgSQL function "add_foo" line 241 at SQL statement

Before the savepoint is only a couple of statements: one insert statement
and another insert statement using "returning *" into a variable. The
function parameters use %TYPE in order to help ensure the parameters match
the same type as the table column it is meant to deal with. The function's
return value is a rowtype of the results from the insert/returning right
before the savepoint.

If I comment out the few lines regarding savepoints, the function works (but
without error trapping of course), so I know it's not a syntax error or some
other type of error. PostgreSQL for some reason wants to use
SPI_execute_plan_with_paramlist and this causes the error.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2010-06-11 19:19:13 Re: BUG #5488: pg_dump does not quote column names -> pg_restore may fail when upgrading
Previous Message Dimitri Fontaine 2010-06-11 18:46:22 Re: BUG #5488: pg_dump does not quote column names -> pg_restore may fail when upgrading