Outdated version of the documentation. Find the latest one here.

DB Manager Plugin

The DB Manager Plugin is officially part of QGIS core and intends to replace the SPIT Plugin and additionally to integrate all other database formats supported by QGIS in one user interface. The icon_dbmanager DB Manager Plugin provides several features. You can drag layers from the QGIS Browser into the DB Manager and it will import your layer into your spatial database. You can drag and drop tables between spatial databases and they will get imported. You can also use the DB Manager to execute SQL queries against your spatial database and then view the spatial output for queries by adding the results to QGIS as a query layer.

Figure DB Manager 1:


DB Manager dialog nix

The Database menu allows to connect to an existing database, to start the SQL-window and to exit the DB Manager Plugin. One you are connected to an existing database, the menus Schema and Table additionally appear.

The Schema menu includes tools to create and delete (empty) schemas and, if topology is available (e.g. PostGIS 2) to start a TopoViewer.

The menu Table allows to create and edit tables and to delete tables and views. It is also possible to empty tables and to move tables from one to another schema. As further functionality you can perform a VACUUM and then an ANALYZE for each selected table. Plain VACUUM simply reclaims space and makes it available for re-use and ANALYZE updates statistics to determine the most efficient way to execute a query. Finally you can import layers/files, if they are loaded in QGIS or exist in the file system. And you can export database tables to Shape with the Export file feature.

The Tree window lists all existing databases supported by QGIS. With a double-click you can connect to the database. With the right-mouse button you can rename and delete existing schemas and tables. Tables can also be added to the QGIS canvas with the context menu.

Wenn Sie mit einer Datenbank verbunden sind, bietet das Hauptfenster des DB Managers frei Reiter. Der Info Reiter zeigt Information zur Tabelle und Geometrie, zu existierenden Spalten, Constraints und Indices. Ausserdem kann man die Vacuum Analyze Funktion starten und einen räumlichen Index für eine ausgewählte Tabelle erzeugen. Der Table Reiter zeigt die Attribute und der Reiter Preview zeigt eine Vorschau der Tabelle.