RT Sql Layer is a QGIS plugin written by Giuseppe Sucameli for Faunalia and Regione Toscana-SIGTA, which in turn is based upon the PostGIS Manager plugin from Martin Dobias. The plugin was slightly adapted to the PostGIS Viewer and was added following the post called Loading QGIS plugins into PyQGIS standalone applications (in Spanish). Likewise, it would be possible to adapt other QGIS plugins to be included in the PostGIS Viewer for pgAdmin.
Python, PyQt4, PyQGIS, libqt4-sql-psql and psycopg2 (for the Query Builder).
How to install prerequisites in Windows: See this post, you will also need to install psycopg2 from OSGeo4W.
How to install prerequisites in Ubuntu/Linux: For QGIS, see downloads official page. For the other programs use apt-get or Synaptic.
This time the installation process has been reduced to extract one ZIP file (download the zip file here) into the appropriate path (on Windows: C:/Archivos de programa/PostgreSQL/8.4/bin/ whereas on Ubuntu/Linux: /usr/bin/) and edit the pgAdmin plugins.ini file.
On Ubuntu/Linux you will need the sudo command to extract and set the 755 permissions to the extracted files, this way:
Additionally, copy the next lines to /usr/share/pgadmin3/plugins.ini (if the file does not exist, you have to create it):
On Windows edit C:/Archivos de programa/PostgreSQL/8.4/pgAdmin III/plugins.ini adding the following lines:
The postgis_viewer.bat file sets the OSGeo4W environment variables (Qt, Python, QGIS) to allow the execution of postgis_viewer.py The .bat file assumes OSGeo4W is installed in C:/ and PostgreSQL can be found in C:/Archivos de programa/PostgreSQL/8.4/ You should check that file if you get some troubles while running the plugin.
- With PyQt4 < 4.6 you will probably get some weird display of the layer properties when dragging a layer. You may check the PyQt4 version from a Python command line this way (If you get a version less than 4.6, you have to upgrade your PyQt4 installation):
- If you can not get the icons loaded in the plugin's window, check lines 62 and 65 of the postgis_viewer.py file. There you can edit the path to your postgis_viewer_imgs folder. Note that in Ubuntu/Linux you will probably need the full path whereas in Windows you just need a relative path (according to the tests done).
- Ivan Mincik's PostGIS Viewer: https://github.com/imincik/QgsPostGIS-Viewer
- Send and receive a signal between 2 Qt applications: http://www.qtcentre.org/threads/38453-Send-and-receive-a-signal-between-2-Qt-applications.?p=176716#post176716
- Single Application: http://www.qtcentre.org/wiki/index.php?title=SingleApplication
- Quantum GIS Development Team, 2011. Quantum GIS, Geographic Information System API Documentation. Open Source Geospatial Foundation Project. Electronic document: http://doc.qgis.org/
- RT Sql Layer 1.0.14. Giuseppe Sucameli for Faunalia and Regione Toscana-SIGTA http://www.faunalia.it/qgis/rt_sql_layer.zip