]> git.ipfire.org Git - thirdparty/psycopg.git/commit
Clear the prepared statements if the catalog might have changed
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 22 Sep 2021 20:10:09 +0000 (22:10 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 23 Sep 2021 01:48:35 +0000 (03:48 +0200)
commitd770a0fd19d991b1c11c993f9ff9ceabddf249ff
tree5493a16f27b1390824f0970092a9fce890539d78
parent11fd7e90b26925f3ec2eab4593af81fcc37a9cd8
Clear the prepared statements if the catalog might have changed

This could happen on DROP (and re-creation) of some object or on the
implicit drop caused by a rollback.

Issues happen if a prepared transaction is executed after an object has
been dropped: see
https://github.com/sqlalchemy/sqlalchemy/issues/6842#issuecomment-925131836

Postgres devs suggestion is to avoid to do that: see
https://www.postgresql.org/message-id/2220999.1632335261%40sss.pgh.pa.us
psycopg/psycopg/_preparing.py
psycopg/psycopg/connection.py
psycopg/psycopg/cursor.py
psycopg/psycopg/transaction.py
tests/test_prepared.py