Search Postgresql Archives

Re: how to use SAVEPOINT in stored function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/5/05, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
> In plpgsql, you're supposed to use exception blocks instead.

AFAIC, SAVEPOINT usage isn't permitted in any procedural language. But
it also isn't documented. (I couldn't find any phrase mentioning about
this in the docs.)

One more question, if we'd try to use a SAVEPOINT inside an SQL
function, it dumps below error:
  ERROR:  SAVEPOINT is not allowed in a SQL function
  CONTEXT:  SQL function "tmp_func" during startup
But we got below error message if we'd try the same in a pl/pgsql precedure:
  ERROR:  SPI_execute_plan failed executing query "SAVEPOINT svp0":
  SPI_ERROR_TRANSACTION
  CONTEXT:  PL/pgSQL function "tmp_func" line 4 at SQL statement

Is it possible to make the latter error message some more informative
and user-friendly like the one in the previous?


Regards.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux