pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: arturocuya099@gmail.com
Subject: About the return states of SPI_execute for plpy.execute().status()
Date: Mon, 15 Feb 2021 15:25:09 +0000
Message-ID: <161340270933.3462.11448419214943107350@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/spi-spi-execute.html
Description:

Hello. I'm using Postgres 9.3.25. I know it's an unsupported version but the
documentation pages that I will mention stay the same between 9.3 and 13.

In the docs for Database Access with PL/Python [1] it is mentioned that for
the result object of plpy.execute(), the function status() can be called and
it returns "The SPI_execute() return value". However when testing it the
status function returns a number. In the specific test I made it returns
"11". The problem is that the SPI_execute() documentation [2] does not
mention which numeric constant each return code is assigned to. I would
expect 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 be
more explicit about the meaning of the status() return value. I have not
read the whole PL/Python documentation yet, but if there is any resource
that maps the raw integer that status() returns to the correct code for the
SPI_execute() return value, it would be very helpful to mention it in the
status() documentation.

[1] https://www.postgresql.org/docs/current/plpython-database.html
[2] https://www.postgresql.org/docs/current/spi-spi-execute.html


view thread (3+ messages)  latest in thread

Message-ID: <161340270933.3462.11448419214943107350@wrigleys.postgresql.org>
Permalink:  ../161340270933.3462.11448419214943107350@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/161340270933.3462.11448419214943107350@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, arturocuya099@gmail.com
  Subject: Re: About the return states of SPI_execute for plpy.execute().status()
  In-Reply-To: <161340270933.3462.11448419214943107350@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox