Skip to content

Commit aa2d0e6

Browse files
authoredOct 17, 2024
notice also the MERGE command (#1185)
1 parent 327f2a7 commit aa2d0e6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎asyncpg/prepared_stmt.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ async def explain(self, *args, analyze=False):
147147
# will discard any output that a SELECT would return, other
148148
# side effects of the statement will happen as usual. If you
149149
# wish to use EXPLAIN ANALYZE on an INSERT, UPDATE, DELETE,
150-
# CREATE TABLE AS, or EXECUTE statement without letting the
151-
# command affect your data, use this approach:
150+
# MERGE, CREATE TABLE AS, or EXECUTE statement without letting
151+
# the command affect your data, use this approach:
152152
# BEGIN;
153153
# EXPLAIN ANALYZE ...;
154154
# ROLLBACK;

‎asyncpg/protocol/prepared_stmt.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ cdef class PreparedStatementState:
142142
# that the user tried to parametrize a statement that does
143143
# not support parameters.
144144
hint += (r' Note that parameters are supported only in'
145-
r' SELECT, INSERT, UPDATE, DELETE, and VALUES'
145+
r' SELECT, INSERT, UPDATE, DELETE, MERGE and VALUES'
146146
r' statements, and will *not* work in statements '
147147
r' like CREATE VIEW or DECLARE CURSOR.')
148148

‎tests/test_exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async def test_exceptions_str(self):
4242
self.assertEqual(
4343
e.detail,
4444
"Function's final statement must be SELECT or "
45-
"INSERT/UPDATE/DELETE RETURNING.")
45+
"INSERT/UPDATE/DELETE/MERGE RETURNING.")
4646
self.assertIn(
4747
'DETAIL: Function', str(e)
4848
)

0 commit comments

Comments
 (0)
Failed to load comments.