Presently, when attempting to connect to glaredb over the postgres protocol with the psycopg2 python module, unless connection.autocommit = True, psycopg2 will attempt to wrap all cursor operations in a transaction, sending BEGIN TRANSACTION queries to glaredb. As a result, queries throw an exception and users see the PGRES_EMPTY_QUERY error. Setting autocommit to true, disables the "wrap in a transaction" behavior.
The solution to this is somewhat difficult. We could (and should) improve the error message so users know that they were sending a transaction when they didn't mean to. It is (probably) correct to error early when we see a transaction that we shouldn't.
Presently, when attempting to connect to
glaredb
over the postgres protocol with the psycopg2 python module, unlessconnection.autocommit = True
, psycopg2 will attempt to wrap all cursor operations in a transaction, sendingBEGIN TRANSACTION
queries to glaredb. As a result, queries throw an exception and users see thePGRES_EMPTY_QUERY
error. Setting autocommit to true, disables the "wrap in a transaction" behavior.The solution to this is somewhat difficult. We could (and should) improve the error message so users know that they were sending a transaction when they didn't mean to. It is (probably) correct to error early when we see a transaction that we shouldn't.
Uncovered by the testing in #2258.