Re: About the return states of SPI_execute for plpy.execute().status()
От | Euler Taveira |
---|---|
Тема | Re: About the return states of SPI_execute for plpy.execute().status() |
Дата | |
Msg-id | a3e40711-51a2-4421-834f-d7c072a057ee@www.fastmail.com обсуждение исходный текст |
Ответ на | About the return states of SPI_execute for plpy.execute().status() (PG Doc comments form <noreply@postgresql.org>) |
Ответы |
Re: Re: About the return states of SPI_execute for plpy.execute().status()
|
Список | pgsql-docs |
On Mon, Feb 15, 2021, at 12:25 PM, PG Doc comments form wrote:
Hello. I'm using Postgres 9.3.25. I know it's an unsupported version but thedocumentation pages that I will mention stay the same between 9.3 and 13.
You should upgrade as soon as possible.
In the docs for Database Access with PL/Python [1] it is mentioned that forthe result object of plpy.execute(), the function status() can be called andit returns "The SPI_execute() return value". However when testing it thestatus function returns a number. In the specific test I made it returns"11". The problem is that the SPI_execute() documentation [2] does notmention which numeric constant each return code is assigned to. I wouldexpect that the number 11 maps to the 11th code in the Return Value list,but only 10 non-negative values are listed. I think the PL/Python can bemore explicit about the meaning of the status() return value. I have notread the whole PL/Python documentation yet, but if there is any resourcethat maps the raw integer that status() returns to the correct code for theSPI_execute() return value, it would be very helpful to mention it in thestatus() documentation.
It is referring to the SPI_execute() return values [1] whose mapped integers
are available in [2]. 11 refers to INSERT ... RETURNING. Maybe PL/Python should
expose these SPI constants too (if it doesn't).
В списке pgsql-docs по дате отправления: