From: Adam B. <ad...@no...> - 2003-11-30 14:09:05
|
On Sat, Nov 29, 2003 at 06:13:35PM +0100, Karsten Hilbert wrote: > cursor.execute('end;vacuum analyze;begin;') > we use this successfully around "create database" Don't you have a feeling it's a bit ugly? ;-) DBI, and especially cursor objects, weren't invented for DDL commands, only for DMLs. Personally, I think that DBI spec should be somehow enhanced so that it would cover such situations. As an acceptable solution I usually use plain libpq module here. The goal can be achieved with following code: from pyPgSQL import PgSQL conn = PgSQL.connect(...) ... conn.conn.query("vacuum analyze") Of course it will work with pyPgSQL only :^) Best regards, -- Adam Buraczewski <adamb (at) nor (dot) pl> * Linux user #165585 GCS/TW d- s-:+>+:- a C+++(++++) UL++++$ P++ L++++ E++ W+ N++ o? K w-- O M- V- PS+ !PE Y PGP+ t+ 5 X+ R tv- b+ DI D G++ e+++>++++ h r+>++ y? |