<feed xmlns='http://www.w3.org/2005/Atom'>
<title>postgresql.git/src/pl/plpython/expected/plpython_test.out, branch master</title>
<subtitle>This is the main PostgreSQL git repository.</subtitle>
<id>http://git.postgresql.org/cgit/postgresql.git/atom?h=master</id>
<link rel='self' href='http://git.postgresql.org/cgit/postgresql.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/'/>
<updated>2022-03-08T02:20:51Z</updated>
<entry>
<title>plpython: Remove regression test infrastructure for Python 2.</title>
<updated>2022-03-08T02:20:51Z</updated>
<author>
<name>Andres Freund</name>
</author>
<published>2022-03-08T02:19:56Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=db23464715f4792298c639153dda7bfd9ad9d602'/>
<id>urn:sha1:db23464715f4792298c639153dda7bfd9ad9d602</id>
<content type='text'>
Since 19252e8ec93 we reject Python 2 during build configuration. Now that the
dust on the buildfarm has settled, remove regression testing infrastructure
dealing with differing output between Python 2 / 3.

Reviewed-By: Peter Eisentraut &lt;peter@eisentraut.org&gt;
Reviewed-By: Tom Lane &lt;tgl@sss.pgh.pa.us&gt;
Discussion: https://postgr.es/m/20211031184548.g4sxfe47n2kyi55r@alap3.anarazel.de
</content>
</entry>
<entry>
<title>Transaction control in PL procedures</title>
<updated>2018-01-22T13:43:06Z</updated>
<author>
<name>Peter Eisentraut</name>
</author>
<published>2018-01-22T13:30:16Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=8561e4840c81f7e345be2df170839846814fa004'/>
<id>urn:sha1:8561e4840c81f7e345be2df170839846814fa004</id>
<content type='text'>
In each of the supplied procedural languages (PL/pgSQL, PL/Perl,
PL/Python, PL/Tcl), add language-specific commit and rollback
functions/commands to control transactions in procedures in that
language.  Add similar underlying functions to SPI.  Some additional
cleanup so that transaction commit or abort doesn't blow away data
structures still used by the procedure call.  Add execution context
tracking to CALL and DO statements so that transaction control commands
can only be issued in top-level procedure and block calls, not function
calls or other procedure or block calls.

- SPI

Add a new function SPI_connect_ext() that is like SPI_connect() but
allows passing option flags.  The only option flag right now is
SPI_OPT_NONATOMIC.  A nonatomic SPI connection can execute transaction
control commands, otherwise it's not allowed.  This is meant to be
passed down from CALL and DO statements which themselves know in which
context they are called.  A nonatomic SPI connection uses different
memory management.  A normal SPI connection allocates its memory in
TopTransactionContext.  For nonatomic connections we use PortalContext
instead.  As the comment in SPI_connect_ext() (previously SPI_connect())
indicates, one could potentially use PortalContext in all cases, but it
seems safest to leave the existing uses alone, because this stuff is
complicated enough already.

SPI also gets new functions SPI_start_transaction(), SPI_commit(), and
SPI_rollback(), which can be used by PLs to implement their transaction
control logic.

- portalmem.c

Some adjustments were made in the code that cleans up portals at
transaction abort.  The portal code could already handle a command
*committing* a transaction and continuing (e.g., VACUUM), but it was not
quite prepared for a command *aborting* a transaction and continuing.

In AtAbort_Portals(), remove the code that marks an active portal as
failed.  As the comment there already predicted, this doesn't work if
the running command wants to keep running after transaction abort.  And
it's actually not necessary, because pquery.c is careful to run all
portal code in a PG_TRY block and explicitly runs MarkPortalFailed() if
there is an exception.  So the code in AtAbort_Portals() is never used
anyway.

In AtAbort_Portals() and AtCleanup_Portals(), we need to be careful not
to clean up active portals too much.  This mirrors similar code in
PreCommit_Portals().

- PL/Perl

Gets new functions spi_commit() and spi_rollback()

- PL/pgSQL

Gets new commands COMMIT and ROLLBACK.

Update the PL/SQL porting example in the documentation to reflect that
transactions are now possible in procedures.

- PL/Python

Gets new functions plpy.commit and plpy.rollback.

- PL/Tcl

Gets new commands commit and rollback.

Reviewed-by: Andrew Dunstan &lt;andrew.dunstan@2ndquadrant.com&gt;
</content>
</entry>
<entry>
<title>Format PL/Python module contents test vertically</title>
<updated>2016-10-27T19:41:29Z</updated>
<author>
<name>Peter Eisentraut</name>
</author>
<published>2016-10-19T16:00:00Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=84d457edaf4b3a1e10fd9e100e8ca18c042ad30c'/>
<id>urn:sha1:84d457edaf4b3a1e10fd9e100e8ca18c042ad30c</id>
<content type='text'>
It makes it readable again and makes merges more manageable.
</content>
</entry>
<entry>
<title>PL/Python: Move ereport wrapper test cases to separate file</title>
<updated>2016-06-07T13:39:11Z</updated>
<author>
<name>Peter Eisentraut</name>
</author>
<published>2016-06-07T13:33:41Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=83590771241fc89a944ba7703f506f4ca50f7e5f'/>
<id>urn:sha1:83590771241fc89a944ba7703f506f4ca50f7e5f</id>
<content type='text'>
In commit 5c3c3cd0a3046339597a03bc708cb5530dc07059, the new tests were
apparently just dumped into the first convenient file.  Move them to a
separate file dedicated to testing that functionality and leave the
plpython_test test to test basic functionality, as it did before.
</content>
</entry>
<entry>
<title>Fix PL/Python ereport() test to work on Python 2.3.</title>
<updated>2016-04-09T20:44:54Z</updated>
<author>
<name>Tom Lane</name>
</author>
<published>2016-04-09T20:44:54Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=c7a141a9866b8c15d9e3b6fd5310e54837900394'/>
<id>urn:sha1:c7a141a9866b8c15d9e3b6fd5310e54837900394</id>
<content type='text'>
Per buildfarm.

Pavel Stehule
</content>
</entry>
<entry>
<title>Enhanced custom error in PLPythonu</title>
<updated>2016-04-08T15:33:06Z</updated>
<author>
<name>Teodor Sigaev</name>
</author>
<published>2016-04-08T15:30:25Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=5c3c3cd0a3046339597a03bc708cb5530dc07059'/>
<id>urn:sha1:5c3c3cd0a3046339597a03bc708cb5530dc07059</id>
<content type='text'>
Patch adds a new, more rich,  way to emit error message or exception from
PL/Pythonu code.

Author: Pavel Stehule
Reviewers: Catalin Iacob, Peter Eisentraut, Jim Nasby
</content>
</entry>
<entry>
<title>Make plpython cope with funny characters in function names.</title>
<updated>2016-02-17T02:08:15Z</updated>
<author>
<name>Tom Lane</name>
</author>
<published>2016-02-17T02:08:15Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=66f503868b2ac1163aaf48a2f76d8be02af0bc81'/>
<id>urn:sha1:66f503868b2ac1163aaf48a2f76d8be02af0bc81</id>
<content type='text'>
A function name that's double-quoted in SQL can contain almost any
characters, but we were using that name directly as part of the name
generated for the Python-level function, and Python doesn't like
anything that isn't pretty much a standard identifier.  To fix,
replace anything that isn't an ASCII letter or digit with an underscore
in the generated name.  This doesn't create any risk of duplicate Python
function names because we were already appending the function OID to
the generated name to ensure uniqueness.  Per bug #13960 from Jim Nasby.

Patch by Jim Nasby, modified a bit by me.  Back-patch to all
supported branches.
</content>
</entry>
<entry>
<title>Rearrange the handling of error context reports.</title>
<updated>2015-09-05T15:58:33Z</updated>
<author>
<name>Tom Lane</name>
</author>
<published>2015-09-05T15:58:20Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=0426f349effb6bde2061f3398a71db7180c97dd9'/>
<id>urn:sha1:0426f349effb6bde2061f3398a71db7180c97dd9</id>
<content type='text'>
Remove the code in plpgsql that suppressed the innermost line of CONTEXT
for messages emitted by RAISE commands.  That was never more than a quick
backwards-compatibility hack, and it's pretty silly in cases where the
RAISE is nested in several levels of function.  What's more, it violated
our design theory that verbosity of error reports should be controlled
on the client side not the server side.

To alleviate the resulting noise increase, introduce a feature in libpq
and psql whereby the CONTEXT field of messages can be suppressed, either
always or only for non-error messages.  Printing CONTEXT for errors only
is now their default behavior.

The actual code changes here are pretty small, but the effects on the
regression test outputs are widespread.  I had to edit some of the
alternative expected outputs by hand; hopefully the buildfarm will soon
find anything I fat-fingered.

In passing, fix up (again) the output line counts in psql's various
help displays.  Add some commentary about how to verify them.

Pavel Stehule, reviewed by Petr Jelínek, Jeevan Chalke, and others
</content>
</entry>
<entry>
<title>plpython: Add SPI cursor support</title>
<updated>2011-12-05T17:52:15Z</updated>
<author>
<name>Peter Eisentraut</name>
</author>
<published>2011-12-05T17:52:15Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=89e850e6fda9e4e441712012abe971fe938d595a'/>
<id>urn:sha1:89e850e6fda9e4e441712012abe971fe938d595a</id>
<content type='text'>
Add a function plpy.cursor that is similar to plpy.execute but uses an
SPI cursor to avoid fetching the entire result set into memory.

Jan Urbański, reviewed by Steve Singer
</content>
</entry>
<entry>
<title>Add traceback information to PL/Python errors</title>
<updated>2011-04-06T19:36:06Z</updated>
<author>
<name>Peter Eisentraut</name>
</author>
<published>2011-04-06T19:36:06Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=2bd78eb8d51cc9ee03ba0287b23ff4c266dcd9b9'/>
<id>urn:sha1:2bd78eb8d51cc9ee03ba0287b23ff4c266dcd9b9</id>
<content type='text'>
This mimics the traceback information the Python interpreter prints
with exceptions.

Jan Urbański
</content>
</entry>
</feed>
