PostgreSQL
PostgreSQL is a powerful, open-source, object-relational database management system used globally by some of the world’s best technology companies. Miget’s managed PostgreSQL offering makes it easy to use PostgreSQL in a secure, reliable, and completely hands-off way.
Creating a Database
You can create a PostgreSQL database on Miget in under a minute. Go to app.miget.com, select You App, then Addons -> PostgreSQL -> Add from the Miget Dashboard.
Select PostgreSQL version, currently Miget support:
Warning
PostgreSQL 12 will stop receiving fixes on November 14, 2024. Miget will stop offering PostgreSQL 12.x after that.
-
16.x
-
15.x
-
14.x
-
13.x
-
12.x
Note
You will get the latest available version of PostgreSQL, for example 16.1 for 16.x
Select RAM size and Disk space for your database. RAM size and Disk space count toward your Miget plan's limits. The database storage limit applies to all storage the PostgreSQL database needs, including caches, indices, etc. Backup storage does not count toward your Miget plan's storage limit.
Memory Profiles
Managed Miget's PostgreSQL instances are pre-configured with memory profiles. Miget PostgreSQL plans ranging from 128 Mi to 8 Gi.
If you need more - we can always work with you to provide a custom plan; just contact us at hello@miget.com
| RAM | max_connections |
shared_buffers |
effective_cache_size |
maintenance_work_mem |
work_mem |
|---|---|---|---|---|---|
| 128 Mi | 97 | 32MB | 96MB | 8MB | 84kB |
| 256 Mi | 97 | 64MB | 192MB | 16MB | 168kB |
| 512 Mi | 97 | 128MB | 384MB | 32MB | 337kB |
| 1 Gi | 97 | 256MB | 768MB | 64MB | 675kB |
| 2 Gi | 97 | 512MB | 1536MB | 128MB | 1351kB |
| 4 Gi | 97 | 1GB | 3GB | 256MB | 2702kB |
| 8 Gi | 197 | 2GB | 6GB | 512MB | 2661kB |
Connecting to Your Database
How you connect to your database depends on your code: some frameworks expect a single connection string or URL in an environment variable, while others need multiple connection parameters in a configuration file.
Info
When you add a PostgreSQL addon, Miget will automatically generate and set a DATABASE_URL variable with a value like postgres://fcsn1vo8:PXERTRrlRhTb@postgres-t7hvtfin.migetcyy.eu-east-1.migetapp.internal:5432/t7hvtfin. This means you don’t have to manually configure your database connection—Miget handles it for you, ensuring the connection details are securely stored and easily accessible by your application during runtime.
Connecting from Apps on Miget
Using internal connection values is the recommended way for your apps to connect to your Miget database. The hostname, username, database, and password are displayed on the Addon database page:
An internal connection string that looks like postgres://fcsn1vo8:PXERTRrlRhTb@postgres-t7hvtfin.migetcyy.eu-east-1.migetapp.internal:5432/t7hvtfin is also available if needed. Many database frameworks allow (or require) a connection string instead of individual connection parameters.
Connecting from Outside Miget
You might want to run ad-hoc queries or migrations against your database from machines outside Miget. In these cases you can connect to your database using Ngrok. Please follow Connect to a Miget services using Ngrok.
Backups
We take complete database backups every day and retain all backups for at least 7 days.
Disk Space
We offer PostgreSQL plans ranging from 128 Mi to your current Miget plan's limit of storage per instance. The database storage limit applies to all storage the PostgreSQL database needs, including caches, indices, etc. Backup storage does not count toward your plan’s storage limit.
If you need more - we can always work with you to provide a custom plan; just contact us at hello@miget.com
Metrics
Dashboard
You can view database metrics any time in the Miget Dashboard. Currently, we support the following:
| Metric | Description |
|---|---|
| CPU | The amount of CPU used |
| Memory | The amount of memory used |
You can see these metrics under Miget Overview page.
Database Versions & Upgrades
Miget currently supports PostgreSQL 12, 13, 14, 15 and 16. You can select the major version of your database at creation time, after which it cannot be changed.
We will periodically upgrade the minor version of your databases to apply the latest security fixes. For any maintenance periods that require downtime, we email you ahead of time. We also allow you to run the maintenance yourself, simply stop and start your database from the Miget Dashboard. A newer Docker image of PostgreSQL will run your database.
Upgrading to a New PostgreSQL Major Version
Here’s an overview of the process for upgrading your database to a newer PostgreSQL version:
-
Set up a new database instance with the desired version.
-
Stop any applications that write to the current database to avoid discrepancies between the existing data and the backup.
-
Create a backup of your current database.
-
Restore the backup to the new database instance.
-
Update your applications to connect to the new database and resume their operation.
Depending on your application architecture, this upgrade may involve some downtime.
You can back up your database schema and table data using the pg_dump command. This allows you to export your database to a file (be sure to replace the relevant database variables and update the hostname for Ngrok as needed):
PGPASSWORD={PASSWORD} pg_dump -h 5.tcp.eu.ngrok.io -P 17088 -U {DATABASE_USER} {DATABASE_NAME} \
-n public --no-owner > database_dump.sql
You can then restore this data to your new database:
PGPASSWORD={PASSWORD} psql -h 7.tcp.eu.ngrok.io -P 16678 -U {DATABASE_USER} {DATABASE_NAME} < database_dump.sql
Deleting Databases
If you choose to delete a PostgreSQL instance, we do not keep any backups or snapshots of your data. Be sure to download a backup before proceeding with deletion.
PostgreSQL Extensions
Miget PostgreSQL databases support many popular extensions, such as pgvector, postgis, and others. The specific PostgreSQL version of your database determines which extensions are available and how they can be added.
PostgreSQL 13 and later
To enable any supported extension, run the CREATE EXTENSION command, for example:
CREATE EXTENSION postgis;
To run this command, you can start a psql session in your terminal, for example:
psql -h 7.tcp.eu.ngrok.io -P 16678 -U {DATABASE_USER}

