diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2020-01-08 21:48:44 +0100 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2020-01-08 22:47:22 +0100 |
| commit | 37f21ed132d1c5aee88e81fee0a0b7e735673d35 (patch) | |
| tree | 42c54d36c636f68c961783f5a6252ed743b80122 /src/pl/plpython/sql | |
| parent | f5d28710c707ad602cd869602e092cc9d538cbb9 (diff) | |
| download | postgresql-37f21ed132d1c5aee88e81fee0a0b7e735673d35.tar.gz | |
Remove support for Python older than 2.6
Supporting very old Python versions is a maintenance burden,
especially with the several variant test files to maintain for Python
<2.6.
Since we have dropped support for older OpenSSL versions in
7b283d0e1d1d79bf1c962d790c94d2a53f3bb38a, RHEL 5 is now effectively
desupported, and that was also the only mainstream operating system
still using Python versions before 2.6, so it's a good time to drop
those as well.
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/98b69261-298c-13d2-f34d-836fd9c29b21%402ndquadrant.com
Diffstat (limited to 'src/pl/plpython/sql')
| -rw-r--r-- | src/pl/plpython/sql/plpython_subtransaction.sql | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/pl/plpython/sql/plpython_subtransaction.sql b/src/pl/plpython/sql/plpython_subtransaction.sql index 398c65720c..38c8617828 100644 --- a/src/pl/plpython/sql/plpython_subtransaction.sql +++ b/src/pl/plpython/sql/plpython_subtransaction.sql @@ -8,43 +8,6 @@ CREATE TABLE subtransaction_tbl ( i integer ); --- Explicit case for Python <2.6 - -CREATE FUNCTION subtransaction_test(what_error text = NULL) RETURNS text -AS $$ -import sys -subxact = plpy.subtransaction() -subxact.__enter__() -exc = True -try: - try: - plpy.execute("INSERT INTO subtransaction_tbl VALUES (1)") - plpy.execute("INSERT INTO subtransaction_tbl VALUES (2)") - if what_error == "SPI": - plpy.execute("INSERT INTO subtransaction_tbl VALUES ('oops')") - elif what_error == "Python": - raise Exception("Python exception") - except: - exc = False - subxact.__exit__(*sys.exc_info()) - raise -finally: - if exc: - subxact.__exit__(None, None, None) -$$ LANGUAGE plpythonu; - -SELECT subtransaction_test(); -SELECT * FROM subtransaction_tbl; -TRUNCATE subtransaction_tbl; -SELECT subtransaction_test('SPI'); -SELECT * FROM subtransaction_tbl; -TRUNCATE subtransaction_tbl; -SELECT subtransaction_test('Python'); -SELECT * FROM subtransaction_tbl; -TRUNCATE subtransaction_tbl; - --- Context manager case for Python >=2.6 - CREATE FUNCTION subtransaction_ctx_test(what_error text = NULL) RETURNS text AS $$ with plpy.subtransaction(): |
