|Documentation

Your instance's database

The database included with every instance

Every instance has its own PostgreSQL database with the PostGIS extension. We install it with the instance and run it for you; it is shared with no other instance. Your published projects read their layers from it, and what is edited from the portal is written straight into it.

On the instance's page (Instances, then Manage), the PostgreSQL / PostGIS card shows the space the database takes. The same figure appears in the Database counter of the Overview tab, and counts towards your plan's limits: see quotas.

Connection settings, from the Pro plan

To open the database from QGIS or another tool, you need its connection settings. They are under Connection details, in the PostgreSQL / PostGIS card, and are reserved for the Pro plan and above. On other plans, the section carries the PRO tag and offers Go Pro, which leads to the LizPack plans.

The database card, expanded: the space used and the five connection details, hidden and copyable.

Without these settings, your maps work normally: the projects you publish use the database without you having to connect to it. The right follows the plan of the account owner. A team member whose View the databases permission has been removed receives neither the user nor the password.

Connecting from QGIS

The connection uses the five values under Connection details: Database, User, Password, Host and Port. The password is hidden: the eye shows it, the icon next to it copies the value.

  1. Open the instance's page from Instances, Components tab, and expand the PostgreSQL / PostGIS card.
  2. In QGIS, create a new PostgreSQL connection from the Data Source Manager.
  3. Copy the host, the port and the database name. Enter the user and the password under basic authentication.
  4. Test the connection, then save it. Your tables appear under this connection in the QGIS Browser.

The host and the port

The host is not the address of your portal. It is the database address of the server hosting your instance, shared by all the databases on that server; the port is what designates yours. This port is not PostgreSQL's usual 5432: replace the value QGIS suggests with the one on the instance page.

The connection is encrypted. The SSL mode QGIS offers by default works, and so does require; the modes that verify the certificate (verify-ca, verify-full) fail. If the connection fails with the right values, check that your network allows outgoing connections to this port: some corporate networks block them.

Publishing a project that uses the database

Upload the project as QGIS saved it, with this connection. On upload, we route its layers through the inside of the server: the portal does not use the database's public address. The LizPack Publisher extension can also list your tables and add them to QGIS: see PostGIS layers.

The upload refuses a project in which a PostgreSQL layer points to a database other than the instance's: another host, database, port or user. The refusal message gives the expected values.

Working in the database

With the same settings, any PostgreSQL client will do: pgAdmin, DBeaver, psql. You work in it as in any PostGIS database: import layers, write queries, build views, create indexes, export your data.

Where your tables go

Your user creates its tables in the schema named after your instance; it is its default schema. The public schema, where PostGIS lives, is there for using its functions: you cannot create tables in it. Nor can you create other schemas.

A table you create by hand has no spatial index. On a large layer, creating one makes a big difference to how fast your maps display.

Sending a GeoPackage into the database

A GeoPackage file uploaded to Files can be sent into the database without going through a PostgreSQL client. Right-click the .gpkg file and choose Transfer to the database. This option only appears from the Pro plan.

The Transfer to the database window asks for a Destination schema, then lists the file's layers: new ones will be created, those that already exist are skipped. The processing continues on the server: you can close the window without interrupting it.

Ticking Tronquer et remplacer on a layer that already exists erases the table's current data before loading the file's data into it.