Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitba529a6

Browse files
committed
Update plpython_subtransaction alternative expected files
The original patch only targeted Python 2.6 and newer, since that iswhat we have supported in PostgreSQL 13 and newer. For olderbranches, we need to fix it up for older Python versions.
1 parent25c171f commitba529a6

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

‎src/pl/plpython/expected/plpython_subtransaction.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ AS $$
239239
try:
240240
with plpy.subtransaction() as s:
241241
s.__exit__(None, None, None)
242-
except ValueError as e:
242+
except ValueError, e:
243243
raise ValueError(e)
244244
$$ LANGUAGE plpythonu;
245245
SELECT subtransaction_exit_without_enter();

‎src/pl/plpython/expected/plpython_subtransaction_0.out

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,14 @@ ERROR: could not compile PL/Python function "subtransaction_enter_subtransactio
222222
DETAIL: SyntaxError: invalid syntax (line 3)
223223
CREATE FUNCTION subtransaction_exit_subtransaction_in_with() RETURNS void
224224
AS $$
225-
with plpy.subtransaction() as s:
226-
s.__exit__(None, None, None)
225+
try:
226+
with plpy.subtransaction() as s:
227+
s.__exit__(None, None, None)
228+
except ValueError, e:
229+
raise ValueError(e)
227230
$$ LANGUAGE plpythonu;
228231
ERROR: could not compile PL/Python function "subtransaction_exit_subtransaction_in_with"
229-
DETAIL: SyntaxError: invalid syntax (line3)
232+
DETAIL: SyntaxError: invalid syntax (line4)
230233
SELECT subtransaction_exit_without_enter();
231234
ERROR: ValueError: this subtransaction has not been entered
232235
CONTEXT: Traceback (most recent call last):

‎src/pl/plpython/expected/plpython_subtransaction_5.out

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,14 @@ ERROR: could not compile PL/Python function "subtransaction_enter_subtransactio
222222
DETAIL: SyntaxError: invalid syntax (<string>, line 3)
223223
CREATE FUNCTION subtransaction_exit_subtransaction_in_with() RETURNS void
224224
AS $$
225-
with plpy.subtransaction() as s:
226-
s.__exit__(None, None, None)
225+
try:
226+
with plpy.subtransaction() as s:
227+
s.__exit__(None, None, None)
228+
except ValueError, e:
229+
raise ValueError(e)
227230
$$ LANGUAGE plpythonu;
228231
ERROR: could not compile PL/Python function "subtransaction_exit_subtransaction_in_with"
229-
DETAIL: SyntaxError: invalid syntax (<string>, line3)
232+
DETAIL: SyntaxError: invalid syntax (<string>, line4)
230233
SELECT subtransaction_exit_without_enter();
231234
ERROR: ValueError: this subtransaction has not been entered
232235
CONTEXT: Traceback (most recent call last):

‎src/pl/plpython/sql/plpython_subtransaction.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ AS $$
161161
try:
162162
withplpy.subtransaction()as s:
163163
s.__exit__(None, None, None)
164-
except ValueErroras e:
164+
except ValueError, e:
165165
raise ValueError(e)
166166
$$ LANGUAGE plpythonu;
167167

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp