Skip to content

Commit

Permalink
notice also the MERGE command (#1185)
Browse files Browse the repository at this point in the history
  • Loading branch information
MeggyCal authored Oct 17, 2024
1 parent 327f2a7 commit aa2d0e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions asyncpg/prepared_stmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ async def explain(self, *args, analyze=False):
# will discard any output that a SELECT would return, other
# side effects of the statement will happen as usual. If you
# wish to use EXPLAIN ANALYZE on an INSERT, UPDATE, DELETE,
# CREATE TABLE AS, or EXECUTE statement without letting the
# command affect your data, use this approach:
# MERGE, CREATE TABLE AS, or EXECUTE statement without letting
# the command affect your data, use this approach:
# BEGIN;
# EXPLAIN ANALYZE ...;
# ROLLBACK;
Expand Down
2 changes: 1 addition & 1 deletion asyncpg/protocol/prepared_stmt.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ cdef class PreparedStatementState:
# that the user tried to parametrize a statement that does
# not support parameters.
hint += (r' Note that parameters are supported only in'
r' SELECT, INSERT, UPDATE, DELETE, and VALUES'
r' SELECT, INSERT, UPDATE, DELETE, MERGE and VALUES'
r' statements, and will *not* work in statements '
r' like CREATE VIEW or DECLARE CURSOR.')

Expand Down
2 changes: 1 addition & 1 deletion tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def test_exceptions_str(self):
self.assertEqual(
e.detail,
"Function's final statement must be SELECT or "
"INSERT/UPDATE/DELETE RETURNING.")
"INSERT/UPDATE/DELETE/MERGE RETURNING.")
self.assertIn(
'DETAIL: Function', str(e)
)
Expand Down

0 comments on commit aa2d0e6

Please sign in to comment.