From: Rene P. <re...@la...> - 2003-11-29 16:37:22
|
Hello, When I try to issue the statement "vacuum analyze" I get an exception with the error message "VACUUM cannot run inside a BEGIN/END block". This is the code that reproduces the problem: from pyPgSQL import PgSQL db =3D PgSQL.connect(host=3D"myhost", database=3D"mydb", user=3D"myuser", password=3D"mypw") cursor =3D db.cursor() cursor.execute("vacuum analyze") I use pyPgSQL version 2.4 with Python 2.2 on Windows XP. The server is PostgreSQL 7.2.1 on Linux. Is this considered a bug in pyPgSQL? Is there any way to issue "vacuum analyze" from within a Python program? The reason I'm doing this is that my program inserts and deletes lots of records. And the PostgreSQL manual says: "After adding or deleting a large number of records, it may be a good idea to issue a VACUUM ANALYZE command for the affected table. This will update the system catalogs with the results of all recent changes, and allow the PostgreSQL query optimizer to make better choices in planning user queries." Thanks in advance for your help. --=20 Regards / Groeten, http://www.leren.nl Ren=E9 Pijlman http://www.applinet.nl =20 |