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

PostGIS execute SQL


Makes it possible to perform a SQL database query on a PostGIS database connected to QGIS.


Database [string]

Name of the database, not the connection name. By default you don’t have to fill in the name, the current database connection will be chosen.

Default: (not set)

SQL query [string]

Defines the SQL query, for example ‘create schema test;’.

Default: (not set)


Console usage

processing.runalg('qgis:postgisexecutesql', database, sql)

See also