PostGIS Stores#

Overview#

PostGIS Stores are connections to PostGIS databases.

These can be existing local or remote PostGIS databases.

You can also create new PostGIS databases from GeoPackages, ESRI Shapefiles, and PostgreSQL backups.

You can also create new, empty PostGIS databases as well.

Create From Connection#

To add a new Link, click the “Add New” button at top.

../../_images/add-new-postgis-store.png

Populate the required fields for your PostgreSQL connection

../../_images/2-add-new.png

Under Database, click the “Load Database Names” icon

../../_images/3-add-new.png

The list of available databases will appear. Select the database you wish to connect to.

../../_images/4-add-new.png

Select the Group(s) that will have permission to the Store

../../_images/5-add-new.png

Click Save. Your Store has been created.

../../_images/6-add-new.png

Create From File(s)#

You can create a PostGIS database from most common data sources, such as ESRI Shapefiles and GeoPackages

You can also create databases from PostGIS backups.

To create a PostGIS database from a file, click the Create button at top right

../../_images/create-new-store.png

Give your database a name and click the Choose Files button.

../../_images/create-store-from-geopackage-0.png

Browse to the file(s) location

../../_images/create-store-from-geopackage.png

Click the Impprt button

../../_images/create-store-from-geopackage-2.png

The import results are displayed at the bottom of the page.

../../_images/create-store-from-geopackage-3.png

Note

You may need to click the PostGIS tab to refresh before seeing your new database

Create Empty Database#

You can create an empty PostGIS database.

An empty database is useful if you have a QGIS Project and want to connect to the database to import layers.

To create an empty PostGIS database,

Click the Create Button

../../_images/create-new-store.png

Give your database a name and check the “Create Only” box.

../../_images/create-db-only.png

Your database has been created and added as a PostGIS Store

../../_images/db-connection-info.png

To view the database connection information, click the Connection icon at right

../../_images/show-connection.png

This information can be used in your pg_service.conf file and any other location

../../_images/pg-service-connection.png

Layer Creation#

If your QGIS Project uses a PostGIS backend, the PostGIS Store will be automatically detected when the QGIS Store is added.

Once you have created a PostGIS Store, it can be used to create a PostGIS Layer.

create-postgis-completed.png

../../_images/create-postgis-completed.png

create-postgis-completed-qgs-confirm.png

../../_images/create-postgis-completed-qgs-confirm.png

create-postgis-database.png

../../_images/create-postgis-database.png

create-postgis-database-completed.png

../../_images/create-postgis-database-completed.png

create-postgis-import.png

../../_images/create-postgis-import.png

create-postgis-upload.png

../../_images/create-postgis-upload.png

create-postgis-upload-qgs-option.png

../../_images/create-postgis-upload-qgs-option.png

create-postgis-upload-selected.png

../../_images/create-postgis-upload-selected.png

postgis-backup.png

../../_images/postgis-backup.png

postgis-backup-name.png

../../_images/postgis-backup-name.png

postgis-clone.png

../../_images/postgis-clone.png

postgis-clone-clone.png

../../_images/postgis-clone-clone.png

postgis-clone-verified.png

../../_images/postgis-clone-verified.png

postgis-restore.png

../../_images/postgis-restore.png

postgis-restore-select.png

../../_images/postgis-restore-select.png

postgis-show-connection.png

../../_images/postgis-show-connection.png

postgis-show-connection-show.png

../../_images/postgis-show-connection-show.png