pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kieran McCusker <kieran.mccusker@gmail.com>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: plpython does not honour max-rows
Date: Tue, 02 May 2023 10:02:30 -0400
Message-ID: <2678018.1683036150@sss.pgh.pa.us> (raw)
In-Reply-To: <CAGgUQ6FMfBrCTeu7DLUmmsSVn0zu02mx7xZ39etb26pAqTrM+w@mail.gmail.com>
References: <CAGgUQ6H6qYScctOhktQ9HLFDDoafBKHyUgJbZ6q_dOApnzNTXg@mail.gmail.com>
	<711512C7-2BC2-4901-A368-6A5A23023F72@yesql.se>
	<CAGgUQ6GBpw-vkzxuuTk3au8Hq+YezG5sv3yR=YjE3CbOqp-a3Q@mail.gmail.com>
	<D2132F23-B3AF-4D98-9859-BC2B64A599EC@yesql.se>
	<CAGgUQ6FMfBrCTeu7DLUmmsSVn0zu02mx7xZ39etb26pAqTrM+w@mail.gmail.com>

Kieran McCusker <kieran.mccusker@gmail.com> writes:
> Without making too much of a fuss, wouldn't it be simpler to honour a
> row-limit of zero rather than document that it doesn't work?

plpy.execute is a thin wrapper around SPI_execute, which does document
this point:

   If <parameter>count</parameter> is zero then the command is executed
   for all rows that it applies to.  If <parameter>count</parameter>
   is greater than zero, then no more than <parameter>count</parameter> rows
   will be retrieved; execution stops when the count is reached, much like
   adding a <literal>LIMIT</literal> clause to the query.

Since that's stood for a few decades now, changing it seems impossible
from the backwards-compatibility standpoint.  However, it does seem
appropriate to repeat that material in the wrapper's documentation.

I wonder whether the similar plperl and pltcl wrappers are also
documentation-shy here.

			regards, tom lane





view thread (12+ messages)  latest in thread

Message-ID: <2678018.1683036150@sss.pgh.pa.us>
Permalink:  ../2678018.1683036150@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2678018.1683036150@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, kieran.mccusker@gmail.com, daniel@yesql.se, pgsql-bugs@lists.postgresql.org
  Subject: Re: plpython does not honour max-rows
  In-Reply-To: <2678018.1683036150@sss.pgh.pa.us>

* 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