Re: [HACKERS] SPI and transactions

2015-11-22 Thread Craig Ringer
On 18 November 2015 at 18:18, Konstantin Knizhnik wrote: > But now SPI is used not only inside UDFs. It is also used in background > workers. For example in receiver_raw, written by Michael Paquier (I lot of > thanks Michael, understand logical replication without them will be much > more diffic

Re: [HACKERS] SPI and transactions

2015-11-19 Thread Robert Haas
On Wed, Nov 18, 2015 at 5:18 AM, Konstantin Knizhnik wrote: > Hello, > > SPI was originally developed for execution SQL statements from C user > defined functions in context of existed transaction. > This is why it is not possible to execute any transaction manipulation > statement (BEGIN, COMMIT,

[HACKERS] SPI and transactions

2015-11-18 Thread Konstantin Knizhnik
Hello, SPI was originally developed for execution SQL statements from C user defined functions in context of existed transaction. This is why it is not possible to execute any transaction manipulation statement (BEGIN, COMMIT, PREPARE,...) using SPI_execute:SPI_ERROR_TRANSACTION is returned.