I receive an python error when starting the postgis manager pluging in QGIS. This problem started when moving from QGIS 1.7.0 to QGIS 1.8.0 Lisboa. I reinstalled everything but that didin't fixed the problem. I tried to reinstall QGIS 1.7.4 again, but still got an error.

Hope someone can help.

The error is:

An error has occured while executing Python code:

Traceback (most recent call last): File "C:/Users/stefanh/.qgis//python/plugins\postgis_manager\ManagerWindow.py", line 113, in dbConnectInit self.dbConnect(selected) File "C:/Users/stefanh/.qgis//python/plugins\postgis_manager\ManagerWindow.py", line 171, in dbConnect self.dbInfo() File "C:/Users/stefanh/.qgis//python/plugins\postgis_manager\ManagerWindow.py", line 238, in dbInfo self.updateView() File "C:/Users/stefanh/.qgis//python/plugins\postgis_manager\ManagerWindow.py", line 285, in updateView self.tabChanged( self.tabs.currentIndex() ) File "C:/Users/stefanh/.qgis//python/plugins\postgis_manager\ManagerWindow.py", line 212, in tabChanged self.txtMetadata.showDbInfo() File "C:/Users/stefanh/.qgis//python/plugins\postgis_manager\MetadataBrowser.py", line 29, in showDbInfo gis_info = self.db.get_postgis_info() File "C:/Users/stefanh/.qgis//python/plugins\postgis_manager\postgis_utils.py", line 173, in get_postgis_info self._exec_sql(c, "SELECT postgis_lib_version(), postgis_scripts_installed(), postgis_scripts_released(), postgis_geos_version(), postgis_proj_version(), postgis_uses_stats()") File "C:/Users/stefanh/.qgis//python/plugins\postgis_manager\postgis_utils.py", line 748, in _exec_sql raise DbError(e) DbError: function postgis_uses_stats() does not exist LINE 1: ..., postgis_geos_version(), postgis_proj_version(), postgis_us... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

Query: SELECT postgis_lib_version(), postgis_scripts_installed(), postgis_scripts_released(), postgis_geos_version(), postgis_proj_version(), postgis_uses_stats()

Python version: 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]

QGIS version: 1.8.0-Lisboa Lisboa, 6416f38

Python path: ['C:/PROGRA~1/Quantum GIS Lisboa/apps/qgis/./python', 'C:/Users/stefanh/.qgis//python', 'C:/Users/stefanh/.qgis//python/plugins', 'C:/PROGRA~1/Quantum GIS Lisboa/apps/qgis/./python/plugins', 'C:\Program Files\Jahshaka\OpenLibraries\python', 'C:\PROGRA~1\Quantum GIS Lisboa\bin\python27.zip', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\DLLs', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\plat-win', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\lib-tk', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\qgis\bin', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\PIL', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\win32', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\win32\lib', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\Pythonwin', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\PROGRA~1\Quantum GIS Lisboa\apps\qgis\python\plugins\fTools\tools']

  • I have the same problem: in the server 1.5.3 PostGIS version, on my computer 2.0.1 PostGIS version (localhost). QGIS 1.8.0. When I connect to 1.5.3 PostGIS server (database) in PostGIS manager - all is well, but when I connect to 2.0.1 PostGIS version (database) - I receive the same problem. Commented Oct 11, 2012 at 10:25

5 Answers 5


Because of the suggestion of dustymugs I looked for the QGIS PostGIS Manager issue tracker and found that the plugin will not be maintained by the manager.

See: http://lists.osgeo.org/pipermail/qgis-user/2012-May/016967.html


If the error is occurring while attempting to connect to PostGIS 2.0, the function postgis_uses_stats() does not appear to exist anymore. You may want to file a ticket with the QGIS project for that plugin.

PostGIS list of functions

  • The problem occurs indeed when connecting to a PostGIS 2.0 database. I have several databases on various servers. And when I connect to another database with PostGIS 1.5 the PostGIS manager is working. So you have helped me a step further :).
    – Stefan
    Commented Oct 12, 2012 at 7:03

I open a ticket on QGIS mailing list about this problem. The author of the plugin Martin Dobias said this error should be fix in the version 0.5.16. This version is already available to upgrade or installation in QGIS repository and works fine. I upgrade in the QGIS (Windows and Linux OS) and works very good without error of python and Postgis 2.0. So, upgrade your Postgis Manager to remove the error.

Best Regards

José Santos


I see now that the PostGIS Manager is working. I do get the error, but when I click 'close' on the window the PostGIS Manager starts up and works fine (it was hidden behind one of the all the windows on my screen :P)


You should probably use the DB Manager plugin in QGIS as I believe it is replacing the PostGIS manager. DB Manager will handle PostGIS 2.0 without errors.

It should be included in the QGIS 1.8 install by default. It can be found in the Database menu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.