Re: [GENERAL] How to know if SPI or some other API triggered an ERROR.

2016-05-21 Thread dandl
; From: Tom Lane [mailto:t...@sss.pgh.pa.us] > Sent: Sunday, 22 May 2016 12:01 AM > To: dandl > Cc: 'PostgreSQL' > Subject: Re: [GENERAL] How to know if SPI or some other API triggered an > ERROR. > > "dandl" writes: > > The question is whether the

Re: [GENERAL] How to know if SPI or some other API triggered an ERROR.

2016-05-21 Thread Tom Lane
"dandl" writes: > The question is whether there is any way to know that some Postgres API call > such as SPI (or others) did not return but instead triggered an elog(ERROR). I think what you're looking for is to set up a PG_TRY/PG_CATCH block to intercept the error as the stack is being unwound.

[GENERAL] How to know if SPI or some other API triggered an ERROR.

2016-05-21 Thread dandl
The question is whether there is any way to know that some Postgres API call such as SPI (or others) did not return but instead triggered an elog(ERROR). The context is the implementation of a language handler (plandl for Andl) with the possibility of re-entrant calls to functions. I would li