This is what I see with echo=True using the following block: select pg_catalog.version() [raw sql] {}
select current_schema() [raw sql] {} show standard_conforming_strings [raw sql] {} BEGIN (implicit; DBAPI should not BEGIN due to autocommit mode) DROP DATABASE IF EXISTS md_server [raw sql] {} CREATE DATABASE md_server [raw sql] {} ROLLBACK using DBAPI connection.rollback(), DBAPI should ignore due to autocommit mode On Thursday, 24 November 2022 at 21:24:11 UTC+1 zsol...@gmail.com wrote: > Hi, > > I'm trying to run low-level commands like DROP DATABASE / CREATE DATABASE, > with psycopg2. > > In 1.3 I used the following: > > with > pg_engine.connect().execution_options(isolation_level="AUTOCOMMIT",autocommit=True) > > as conn: > conn.execute(command) > > Now in 2.0 I run into many errors. I've read the migration guide and for > me this looks like the best: > > with pg_engine.connect().execution_options(isolation_level="AUTOCOMMIT") > as conn: > conn.exec_driver_sql(command) > > Is this the right one? I'm confused as isolation_level is not written in > the migration guide, I just had it from 1.3. But without isolation_level it > doesn't work. > > Also, what is the difference between exec_driver_sql and execute + text()? > > Zsolt > > > > > -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/08dd6622-0bdf-46fc-8179-f18421640af4n%40googlegroups.com.