3

When I add a new PostGIS database connection to QGIS the dialog asks for the database name.

At times I want to add a database and can't remember the exact name or I want to add a database from a different server and I'm not sure what databases are available.

Is there a way to list all databases on a server within QGIS? I know I could look this information up in pgAdmin but I'd prefer to keep it within QGIS.

1
  • I don't think you can do it in Add PostGIS Layers..., but you can go to DB Manager, connect to a known db and run the following query SELECT datname FROM pg_database WHERE datistemplate = false;. It will list all the databases on the server. But I guess your question is more about being able to see the databases in the Add Layers window. Commented Sep 11, 2017 at 16:11

1 Answer 1

1

As far as I'm aware, this isn't an option directly available in QGIS.

According to Displaying PostGIS geometries using QGIS

The workflow is always identical. The first time, you have to define a connection to PostGIS database ((default values are : host:localhost , port:5432 , Database:postgres)). Then you will load a PostGIS table containing a geometry column as a new QGIS layer. Then this layer can be edited, and you have access to all the other columns (if the type is known by QGIS, else cast to ::text), for example to use it as a color categories, or as proportion field, etc.

QGIS documentation Module: Using Spatial Databases in QGIS¶ doesn't refer to listing of database prior to connection as well. Just directly connect.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.