[sqlalchemy] Re: Create database and transactional blocks strangeness

2009-10-27 Thread Wolodja Wentland
On Tue, Oct 27, 2009 at 16:52 -0400, Michael Bayer wrote: > > Wolodja Wentland wrote: > > * Is there an even better way to do this? ;-) > create_engine() for PG supports an "isolation_level" parameter. But it > only does the four levels PG provides, it doesn't yet have a hook for > Psycopg2's "au

[sqlalchemy] Re: Create database and transactional blocks strangeness

2009-10-27 Thread Michael Bayer
Wolodja Wentland wrote: > On Tue, Oct 27, 2009 at 16:22 -0400, Michael Bayer wrote: >> Wolodja Wentland wrote: >> > >> > def create(self): >> > """Create this database""" >> > # set isolation level to AUTOCOMMIT >> > # postgres can't CREATE databases within a transaction >> > self.

[sqlalchemy] Re: Create database and transactional blocks strangeness

2009-10-27 Thread Wolodja Wentland
On Tue, Oct 27, 2009 at 16:22 -0400, Michael Bayer wrote: > Wolodja Wentland wrote: > > > > def create(self): > > """Create this database""" > > # set isolation level to AUTOCOMMIT > > # postgres can't CREATE databases within a transaction > > self._admin_engine.connect().connection

[sqlalchemy] Re: Create database and transactional blocks strangeness

2009-10-27 Thread Michael Bayer
Wolodja Wentland wrote: > > def create(self): > """Create this database""" > # set isolation level to AUTOCOMMIT > # postgres can't CREATE databases within a transaction > self._admin_engine.connect().connection.connection.set_isolation_level( > ISOLATION_LEVEL_AUTOCOMMIT)