Managed Databases
Frostmoln runs managed PostgreSQL and MySQL instances for you — the platform provisions the virtual machine, attaches persistent storage, configures the server, and gives you a ready-to-use connection. You manage your data; we manage the infrastructure underneath.
Choosing a type and version
Pick PostgreSQL or MySQL at create time. Each type offers several versions, and the create dropdown is the source of truth for what you can launch right now. From the CLI, fm database version list shows each version and its status.
Every version carries a lifecycle status:
| Status | Launchable? | Meaning |
|---|---|---|
current | Yes | Newest fully-supported release |
supported | Yes | Fully supported |
deprecated | Yes (marked) | Still launchable, shown with a (deprecated) marker — plan to move off it |
eol | No | End of life — hidden from the create dropdown |
The recommended version for each type is marked (Recommended). End-of-life and preview versions are not offered for new instances.
Sizing
Instance sizes use the db.gp1.<size> flavor family (general-purpose):
| Flavor | vCPU | RAM |
|---|---|---|
db.gp1.small | 1 | 4 GB |
db.gp1.medium | 2 | 8 GB |
db.gp1.large | 4 | 16 GB |
db.gp1.xlarge | 8 | 32 GB |
db.gp1.2xlarge | 16 | 64 GB |
You choose storage separately (20–1000 GB). The create dialog shows the estimated cost before you confirm.
Create an instance
In the portal, go to Databases → Instances → Create and choose the type, version, flavor, storage size, and the VPC + subnet the instance attaches to. Optionally enable High Availability for PostgreSQL.
Require TLS is on by default for PostgreSQL and MySQL: the server accepts TLS connections only and refuses plaintext. Both negotiate TLS on their one port, so the port stays 5432 (PostgreSQL) or 3306 (MySQL) either way; the setting decides whether a plaintext session is accepted. Turn it off (--require-tls=false in fm, require_tls = false in Terraform) only for clients that cannot use TLS; the instance then also accepts plaintext beside TLS. The setting is fixed when the instance is created: to change it, create a new instance (in Terraform, changing require_tls replaces the instance; an API update that sends a different requireTls is refused with 400 REQUIRE_TLS_IMMUTABLE). See Connect over TLS and MySQL over TLS.
TLS for MySQL is switched on separately from PostgreSQL. Until it is available for MySQL on the platform, a MySQL instance is created without TLS, the portal does not offer the setting, and a create that asks for it is refused with 400 REQUIRE_TLS_UNAVAILABLE.
From the CLI
Lifecycle commands are type-specific (fm database postgres … / fm database mysql …); the cross-type fm database … group lists across types.
fm database postgres instance create \
--name app-db \
--version 16 \
--flavor db.gp1.medium \
--storage 100 \
--vpc my-vpc \
--subnet my-subnet
# MySQL is symmetric:
fm database mysql instance create --name app-db --version 8.4 --flavor db.gp1.small --storage 40 --vpc my-vpc --subnet my-subnet
# Cross-type views:
fm database instance list
fm database version listWith Terraform
resource "frostmoln_postgres_instance" "app" {
name = "app-db"
version = "16"
flavor_id = "db.gp1.medium"
storage_gb = 100
vpc_id = frostmoln_vpc.main.id
subnet_id = frostmoln_subnet.main.id
ha_enabled = true
}Connect
After provisioning, the instance detail page reveals the connection details behind a Show Credentials button (or fm database postgres instance credentials <instance-id>):
- Host — the instance's private address
- Hostname — the instance's DNS name, on an instance with TLS (see Connect over TLS)
- Port —
5432(PostgreSQL) or3306(MySQL) - Username —
pgadmin(PostgreSQL) ormysqladmin(MySQL) - Password — generated for you (rotatable)
- a ready-to-use connection URI — on an instance with TLS it uses the hostname and
sslmode=verify-full(PostgreSQL) orssl-mode=VERIFY_IDENTITY(MySQL)
Databases are reachable from instances on the same VPC (or through fm forward and the fm console); the create flow opens the database port in the instance's security group. Connect like any standard client:
# PostgreSQL with TLS (see below)
psql "host=<hostname> port=5432 user=pgadmin dbname=postgres sslmode=verify-full sslrootcert=frostmoln-customer-ca.pem"
# MySQL with TLS (see below)
mysql -h <hostname> -P 3306 -u mysqladmin -p --ssl-mode=VERIFY_IDENTITY --ssl-ca=frostmoln-customer-ca.pemTIP
Treat the admin credentials like any secret — store them in Secrets or your application's secret store, not in source control.
Connect over TLS
A PostgreSQL instance with a certificate serves TLS on 5432, with a certificate from the Frostmoln customer CA issued for the instance's hostname. The portal shows a TLS badge, the hostname and the Download CA bundle button; fm database postgres instance get (TLS Enabled, Hostname) and Terraform's tls_enabled and hostname attributes report the same.
The hostname has the form <label>.db.<vpc-label>.<tenant-label>.<org-label>.fm.internal and resolves inside the instance's VPC (see Internal DNS names). <label> comes from the instance's name at create (see Names are DNS names); a rename does not change it. Copy the hostname from the instance rather than building it yourself.
Connect to the hostname, not the address. With sslmode=verify-full the client checks that the certificate was issued for the name it connects to. The certificate names the hostname, not the private IP, so a client that connects to the IP with verify-full fails. Weaker modes are not a way out: verify-ca accepts a certificate the CA issued for any Frostmoln-managed service, and require (or libpq's default, prefer) encrypts without checking who answers.
The credentials (Show Credentials, fm database postgres instance credentials) carry the connection URI built for you; use it as given. Host stays the private IP.
postgresql://<username>:<password>@<hostname>:5432/postgres?sslmode=verify-fullConfigure your client to trust the CA bundle and to verify the server's name:
- Download the bundle: the Download CA bundle button,
fm pki ca-bundle --file frostmoln-customer-ca.pem, Terraform'sfrostmoln_ca_bundledata source, or the static copy at/pki/frostmoln-customer-ca.pem. Check its fingerprint as described in Verifying Frostmoln managed-service certificates. - Set it as the root certificate of the connection (
sslrootcertin libpq and the drivers built on it) and keepsslmode=verify-full. Withoutsslrootcert, libpq looks for~/.postgresql/root.crt. - Connect to the hostname. If you connect by address instead (the private IP, or a port forwarded with
fm forward), still verify the certificate against the hostname: give libpq both,host=<hostname>for the name to verify andhostaddr=<address>for where to connect.
# psql, from an instance on the same VPC
psql "host=<hostname> port=5432 dbname=postgres user=pgadmin sslmode=verify-full sslrootcert=frostmoln-customer-ca.pem"
# The same as a libpq URI
psql "postgresql://pgadmin@<hostname>:5432/postgres?sslmode=verify-full&sslrootcert=frostmoln-customer-ca.pem"
# Through a port forwarded with fm forward: connect by address, verify the hostname
fm forward <instance-id> 15432:5432
psql "host=<hostname> hostaddr=127.0.0.1 port=15432 dbname=postgres user=pgadmin sslmode=verify-full sslrootcert=frostmoln-customer-ca.pem"In an application, pass the same settings to the driver. With Python's psycopg:
import os
import psycopg
conn = psycopg.connect(
host="<hostname>",
port=5432,
dbname="postgres",
user="pgadmin",
password=os.environ["PGPASSWORD"],
sslmode="verify-full",
sslrootcert="frostmoln-customer-ca.pem",
)Other libpq-based drivers take the same sslmode and sslrootcert settings; in the Node.js pg driver, pass the bundle as ssl.ca and connect to the hostname.
With Require TLS (the default), plaintext sessions are refused. The portal shows a TLS required badge, fm database postgres instance get shows TLS Required: Yes, and in Terraform require_tls is true. On an instance created with Require TLS off, plaintext is accepted beside TLS on the same port, so it is your client's sslmode that decides: set verify-full.
A read replica has its own hostname and its own certificate, and always its primary's Require TLS setting. Connect to the replica by its own hostname.
MySQL over TLS
A MySQL instance with a certificate serves TLS on 3306, the same port as plaintext, with a certificate from the same CA issued for its hostname (the same <label>.db.…fm.internal form as above). The portal, fm database mysql instance get and Terraform report tlsEnabled, the hostname and Require TLS as for PostgreSQL. MySQL has no high availability, so the hostname always names that one server.
The credentials carry a connection URI built for you. Host stays the private IP.
mysql://<username>:<password>@<hostname>:3306/mysql?ssl-mode=VERIFY_IDENTITYThis URI is for MySQL Shell and other tools that read MySQL connection URIs. Most drivers ignore ssl-mode in a URI, and the URI carries no CA, so give your driver the settings in the table below. Without them, a connection to an instance with Require TLS off can silently fall back to plaintext.
Set your client to VERIFY_IDENTITY or its equivalent: it checks that the certificate chains to the CA bundle and was issued for the hostname you connect to. VERIFY_CA checks the chain only, so it accepts a certificate the CA issued for any Frostmoln-managed service; REQUIRED and the client default, PREFERRED, encrypt without checking who answers. Connect to the hostname, not the IP: the certificate does not name the address.
| Client | Verify the CA bundle and the hostname |
|---|---|
mysql command-line client (Oracle) | --ssl-mode=VERIFY_IDENTITY --ssl-ca=frostmoln-customer-ca.pem |
| Java: MySQL Connector/J | sslMode=VERIFY_IDENTITY, with the bundle imported into a trust store named by trustCertificateKeyStoreUrl, trustCertificateKeyStoreType=PKCS12 and trustCertificateKeyStorePassword |
Go: go-sql-driver/mysql | tls=custom in the DSN, after mysql.RegisterTLSConfig("custom", …) with the bundle in RootCAs and the hostname as ServerName |
PHP: PDO (pdo_mysql) | PDO::MYSQL_ATTR_SSL_CA set to the bundle and PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT set to true (Pdo\Mysql::ATTR_SSL_CA and Pdo\Mysql::ATTR_SSL_VERIFY_SERVER_CERT from PHP 8.4) |
Node.js: mysql2 | ssl: { ca: <the bundle's contents>, rejectUnauthorized: true, verifyIdentity: true }, with the hostname as host (without verifyIdentity, the name is not checked) |
Python: mysqlclient (MySQLdb) | ssl_mode="VERIFY_IDENTITY" and ssl={"ca": "frostmoln-customer-ca.pem"} |
| Python: PyMySQL | ssl_ca="frostmoln-customer-ca.pem", ssl_verify_cert=True and ssl_verify_identity=True |
Some PyMySQL releases fall back to plaintext without an error when the server does not offer TLS. On an instance with Require TLS off, use a PyMySQL release that fixes this, or another driver.
Do not configure a client certificate (for example --ssl-cert and --ssl-key, or a JDBC client keystore). The server checks only that the connection uses TLS; a client certificate that does not chain to the Frostmoln CA makes the handshake fail.
# mysql, from an instance on the same VPC
mysql -h <hostname> -P 3306 -u mysqladmin -p \
--ssl-mode=VERIFY_IDENTITY --ssl-ca=frostmoln-customer-ca.pemJava does not read a PEM file as a trust store. Import each certificate of the bundle into a PKCS #12 trust store first (split the bundle as shown in Compare SHA-256 fingerprints; the bundle holds two roots during a root changeover), then name it in the URL:
# One import per root: keytool reads only the first certificate of a file
# Start from an empty trust store: no leftover alias, no retired root
rm -f frostmoln-truststore.p12
for f in frostmoln-ca-*.pem; do
keytool -importcert -noprompt -alias "${f%.pem}" -file "$f" \
-keystore frostmoln-truststore.p12 -storetype PKCS12 -storepass "$TRUSTSTORE_PASSWORD"
donejdbc:mysql://<hostname>:3306/mysql?sslMode=VERIFY_IDENTITY&trustCertificateKeyStoreUrl=file:/etc/myapp/frostmoln-truststore.p12&trustCertificateKeyStoreType=PKCS12&trustCertificateKeyStorePassword=<truststore-password>In Go, register a TLS configuration with the bundle and the hostname, and name it in the DSN:
pem, err := os.ReadFile("frostmoln-customer-ca.pem")
if err != nil {
log.Fatal(err)
}
roots := x509.NewCertPool()
if !roots.AppendCertsFromPEM(pem) {
log.Fatal("no certificate in the CA bundle")
}
err = mysql.RegisterTLSConfig("custom", &tls.Config{
RootCAs: roots,
ServerName: "<hostname>",
MinVersion: tls.VersionTLS12,
})
if err != nil {
log.Fatal(err)
}
db, err := sql.Open("mysql", "mysqladmin:"+os.Getenv("MYSQL_PASSWORD")+"@tcp(<hostname>:3306)/mysql?tls=custom")With Python's mysqlclient:
import os
import MySQLdb
conn = MySQLdb.connect(
host="<hostname>",
port=3306,
user="mysqladmin",
password=os.environ["MYSQL_PASSWORD"],
database="mysql",
ssl_mode="VERIFY_IDENTITY",
ssl={"ca": "frostmoln-customer-ca.pem"},
)With Require TLS (the default), the server refuses every connection that does not use TLS. A client with TLS turned off (--ssl-mode=DISABLED, or a driver configured without TLS) gets:
ERROR 3159 (HY000): Connections using insecure transport are prohibited while --require_secure_transport=ON.On an instance created with Require TLS off, plaintext is accepted beside TLS, so it is your client's setting that decides: set VERIFY_IDENTITY.
Connecting by address. The mysql client has no way to connect to one address and verify another name, so through a port forwarded with fm forward (or to the private IP) it can only use VERIFY_CA, which checks the chain but not the name. A driver that takes the name to verify separately from the address closes that gap: in Go, ServerName above is verified whatever address tcp(…) names. For an interactive session, use the fm console, which checks the name itself.
A MySQL read replica has its own hostname and its own certificate, and always its primary's Require TLS setting. A replica of an instance created before TLS has no TLS either.
The fm console
fm database postgres console <instance-id> connects psql through a port forward. On an instance with TLS it verifies the server in full: fm downloads the CA bundle on every start into ~/.fm/ca-bundles/ and runs psql with the instance's hostname as host, the forward as address, sslmode=verify-full and the bundle as root certificate. GSS encryption is turned off and PGSERVICE / PGSERVICEFILE are ignored, so neither can weaken that. If the bundle cannot be downloaded, the console does not start.
fm database postgres console <instance-id> -- -U pgadmin -d postgrespsql looks up ~/.pgpass by the instance's hostname, not 127.0.0.1, so a password line there names the hostname (<hostname>:*:*:pgadmin:<password>).
fm database mysql console <instance-id> checks a MySQL instance with TLS before the client starts. fm downloads the CA bundle the same way, opens a connection through the forward, and completes a TLS handshake (TLS 1.2 or newer) that verifies the certificate against the bundle and the instance's hostname. It then closes that connection without logging in, and only then runs mysql against the forward with --ssl-mode=VERIFY_CA and the bundle as --ssl-ca: the client checks the chain on its own connection, and fm has already checked the name. If the check fails, the console does not start.
fm database mysql console <instance-id> -- -u mysqladmin -D mysqlThe MySQL console with TLS needs the Oracle MySQL client. The MariaDB client has no --ssl-mode, so fm refuses it and asks you to install the Oracle MySQL client. Some Linux distributions install the MariaDB client under the name mysql: check with mysql --version.
An instance without TLS connects as before, with any client.
Terraform
require_tlsonfrostmoln_postgres_instanceis optional: omit it for the default (true), or setfalsefor clients that cannot use TLS. Changing it replaces the instance. It cannot be set together withrestore_from: a restore target takes the default, andrequire_tlsreads it back.hostnameandtls_enabledare read-only. Thefrostmoln_postgres_instancedata source andfrostmoln_postgres_read_replicareport all three.- Read the bundle with the
frostmoln_ca_bundledata source. - After a provider upgrade, the first refreshed plan reads the three attributes into state and shows no change on an existing instance, as long as the configuration omits
require_tlsor setsfalse. Settingrequire_tls = trueon an instance created before TLS plans a replacement. frostmoln_mysql_instancehas the samerequire_tls,hostnameandtls_enabled, and its data source andfrostmoln_mysql_read_replicareport them (on a replica,require_tlsis read-only: its primary's). MySQL serves TLS and plaintext on the sameport, soportis always set.
For example, a PostgreSQL instance with TLS required, and the CA bundle pinned to the published fingerprints:
resource "frostmoln_postgres_instance" "orders" {
name = "orders-db"
version = "16"
flavor_id = "db.gp1.medium"
storage_gb = 100
vpc_id = frostmoln_vpc.main.id
subnet_id = frostmoln_subnet.main.id
# The default. Set false only for clients that cannot use TLS; changing it replaces the instance.
require_tls = true
}
data "frostmoln_ca_bundle" "frostmoln" {
# The fingerprints published under Current root fingerprints; the read fails on any other set.
expected_fingerprints = var.frostmoln_ca_fingerprints
}
variable "frostmoln_ca_fingerprints" {
type = set(string)
}
# Save this as frostmoln-customer-ca.pem on the client.
output "frostmoln_ca_pem" {
value = data.frostmoln_ca_bundle.frostmoln.pem
}
# Null on an instance without a certificate.
output "orders_dsn" {
value = frostmoln_postgres_instance.orders.tls_enabled ? "host=${frostmoln_postgres_instance.orders.hostname} port=${frostmoln_postgres_instance.orders.port} dbname=postgres sslmode=verify-full sslrootcert=frostmoln-customer-ca.pem" : null
}A MySQL instance with the default, and the address an application verifies against:
resource "frostmoln_mysql_instance" "shop" {
name = "shop-db"
version = "8.4"
flavor_id = "db.gp1.medium"
storage_gb = 100
vpc_id = frostmoln_vpc.main.id
subnet_id = frostmoln_subnet.main.id
# Omitted: TLS required where TLS for MySQL is available. Changing it replaces the instance.
# require_tls = false
}
# Null on an instance without a certificate.
output "shop_mysql_endpoint" {
value = frostmoln_mysql_instance.shop.tls_enabled ? "${frostmoln_mysql_instance.shop.hostname}:${frostmoln_mysql_instance.shop.port}" : null
}Full attribute reference: frostmoln_postgres_instance, frostmoln_mysql_instance.
Instances without TLS
PostgreSQL instances created before TLS was available have no certificate and get none later: Require TLS cannot be turned on for them either. The portal shows TLS as Not enabled and offers Create an instance with TLS, which opens the create form prefilled with the instance's type, version, flavor, storage, network and high availability setting. Backups, point-in-time recovery, the parameter group, tags and data are not copied, nor the name or the credentials. Require TLS starts on there, as for every new instance: turn it off only if your clients cannot use TLS.
Such an instance reports requireTls and tlsEnabled as false and has no hostname; its credentials carry a URI on the private IP, as before. Its server has no Frostmoln-issued certificate, so a client cannot verify who it is talking to: connect only from instances in the same VPC. To connect with verify-full, create a new instance and move your data to it (for example with pg_dump and pg_restore). Restoring a backup also builds a new instance, and it gets a certificate with Require TLS on.
A MySQL instance created before TLS for MySQL was available is the same: no certificate, now or later, and a URI on the private IP. To connect with VERIFY_IDENTITY, create a new instance and move your data to it (for example with mysqldump), or restore a backup to a new instance.
An instance that requires TLS but has no certificate serves no endpoint at all: it is in status error, and its credentials carry no URI. Delete it and create a new one.
Names are DNS names
The hostname's <label> is the instance's name at create, lowercased, with Latin accents removed (å becomes a, ø becomes o), every run of other characters than a-z and 0-9 turned into one -, any - at the start or end removed, and cut to 63 characters. A name with no letters or digits left becomes db. If another database in the VPC already holds the label, the new one gets -2, -3 and so on appended. That is another reason to take the hostname from the instance instead of building it.
High availability
High availability runs a synchronous standby alongside the primary. While synchronous replication is armed, a commit the primary has acknowledged to your client is already on the standby's disk, so a failover loses nothing that was acknowledged.
- PostgreSQL only. A MySQL instance cannot be created with high availability — the request is rejected.
- Chosen at create time, and fixed for the life of the instance. High availability cannot be added to a running instance or removed from one; changing the setting afterwards is rejected. To move an existing database onto a highly available instance, create a new instance and migrate your data.
- Protection is across hosts, not across availability zones. The pair shares the instance's VPC and subnet, and therefore one availability zone. The two nodes are normally placed on separate physical hosts; when host capacity is scarce the pair may share one, so host separation is best-effort rather than guaranteed. High availability across availability zones is not offered.
- One hostname for the pair. With TLS, the instance's hostname is the pair's stable name: it follows the primary on failover, and its certificate is valid on whichever node is primary. The nodes have names of their own, but your clients should always use the instance's hostname. If a standby is rebuilt without a certificate, the instance reports TLS as not enabled until a later rebuild restores one.
Enable it in the portal's create form, with --ha on the CLI, or with ha_enabled = true in Terraform.
HA status
A highly available instance reports an HA status on its detail page and in the instance list:
| Status | Meaning |
|---|---|
healthy | A synchronous standby is streaming and protecting the primary's writes. |
degraded | One node is serving and nothing is protecting its writes — the standby is unavailable, or is being rebuilt after a failover — or the primary is down and nothing is serving. |
provisioning | The pair is still being built. |
failing_over | A failover is in progress. |
no_standby | The instance has no standby (see below). |
What is guaranteed, and when
A commit is protected against a failover only if it was acknowledged while synchronous replication was armed. The HA status reports that state with a short delay — up to about a minute — so a status reading healthy is not by itself proof that the commit you just made is already on the standby.
If the standby stops streaming, writes block briefly and then continue asynchronously: the platform drops synchronous replication so the instance keeps accepting writes, and reports it as degraded. That is a deliberate trade — the database stays available, and the price is that commits acknowledged during the degraded window are not yet on the standby and can be lost if the primary is lost before the standby catches up. Once the standby is back in sync the status returns to healthy and new commits are protected again.
WARNING
Watch the HA status for anything that must not lose a write. degraded is the window in which losing the primary can cost you acknowledged commits.
Failover
A failover is requested by you — from the portal, with the fm CLI, or through the API. The platform watches the pair continuously and reports its HA status; promoting the standby is a decision you make, not something the platform does on its own.
A failover is accepted only while the HA status is healthy — failing over to a standby that is not in sync would discard acknowledged writes. It also carries a budget: at most 2 failovers per instance per 24 hours, with at least 30 minutes between attempts. An instance that has failed over twice in a day has a fault that another failover does not fix.
A failover cannot replace a primary that has gone down. While the primary is down the HA status reads degraded, so a failover is refused, and the instance is unavailable until the primary is running again. The standby still holds every commit acknowledged while it was in sync. If your application must stay available through the loss of the primary, plan for that downtime.
Your connection endpoint address does not change, and neither does the hostname. That is the whole point of the design — you do not re-point your application, resolve a new name, or update a connection string. Open connections are briefly interrupted and must be re-established, so your client or connection pool needs the usual reconnect logic; after that, everything connects to the same address again.
Instances created before high availability launched
A small number of instances were created with the high-availability flag set before a standby was actually provisioned for them. They report no_standby: there is one node, and no failover protection. no_standby does not resolve on its own, and high availability cannot be added afterwards — create a new instance with high availability and migrate to it. A restore of a highly available instance comes up as no_standby in the same way (see PITR and failover).
Backups and restore
PostgreSQL and MySQL instances support scheduled and on-demand backups. They are opt-in: the portal's create form ticks Enable Automated Backups for you, but on the CLI you pass --backup and in Terraform you set backup_enabled = true — otherwise the instance is created without them. The schedule is a cron expression (0 2 * * * by default). Each backup is encrypted with your tenant's own backup key before it leaves the instance.
Retention is minimum 35 days, maximum 90. Backups are written to immutable, object-locked storage that holds every object for 35 days, so a shorter retention could not delete anything sooner — the API rejects it. Deleting a backup yourself takes effect for you immediately; the stored object is purged once its immutability window has passed.
In the portal, use the Backups tab on the instance. A backup can only be taken while the instance is running. Revoking your tenant's backup key (fm database backup-key revoke) disables backups and restores for every managed database in the tenant until you re-enable it.
Instances created before backups launched
The in-guest backup agent ships inside the instance image, so an instance created before managed backups went live does not carry it: a backup on such an instance stays in creating and never completes. Create a new instance to get backups.
fm database postgres backup list <instance-id>
fm database postgres backup create <instance-id> --name pre-migration
fm database postgres backup delete <instance-id> <backup-id>resource "frostmoln_postgres_instance" "app" {
# … create arguments as above …
backup_enabled = true
backup_schedule = "0 2 * * *"
backup_retention_days = 35
}Restore
Restoring is non-destructive: it provisions a new instance from the source and leaves the source untouched. PostgreSQL instances can also restore to any second inside a restore window — see Point-in-time recovery.
fm database postgres restore <instance-id> --backup <backup-id> --target-name app-db-restoredWhile a restore from an instance is still running — from a backup or to a point in time — the source cannot be deleted: deleting it would make the restore fail. The portal, fm and Terraform all get 409 restore_from_instance_in_progress. Wait until the restored instance is running (or error, if the restore failed), then delete the source.
Deleting an instance is permanent
Deleting an instance removes it and its storage volume. Take a backup first if you may need the data — and keep an independent logical dump somewhere durable such as object storage if you want a copy outside the platform:
pg_dump "host=<host> user=pgadmin dbname=app" > app.sql # PostgreSQL
mysqldump -h <host> -u mysqladmin app > app.sql # MySQLPoint-in-time recovery
Point-in-time recovery (PITR) restores a PostgreSQL instance to any second inside its restore window, not only to the instant a backup was taken. The platform archives the instance's write-ahead log continuously, so while archiving is running at most five minutes of writes are at risk (see When archiving pauses). Like every restore, it builds a new instance and leaves the source untouched.
"Restorable to" — the newest moment you can actually recover to — normally trails real time by a few minutes. On a lightly-written instance it can trail longer, because the platform only advances it once it can prove no later commit is missing. An idle instance can show no window at all after a base backup until it next receives a write.
PITR is PostgreSQL only and requires backups.
# The window: "Restorable from" and "Restorable to"
fm database postgres instance get <instance-id>
fm database postgres restore <instance-id> \
--to-time 2026-09-20T14:30:00Z --target-name app-db-recoveredGive exactly one of --backup and --to-time.
Aim inside the window, not at its edge
"Restorable from" is the later of your oldest usable base backup — the oldest one taken after any interruption in archiving — and the retention cut-off. Once retention is what bounds it, the value advances in real time, so a moment copied from instance get can already have fallen outside the window by the time the restore is submitted.
Which instances can use it
PITR is on by default for new PostgreSQL instances created with backups. A restore — from a backup or to a point in time — produces a PITR-capable instance too, as long as the source had backups on. High availability is no exception: a highly available instance created with backups gets PITR like any other.
Whether an instance can ever do PITR is stamped when it is created, and that stamp is permanent:
- Instances created before PITR launched cannot do it. Restoring one produces a new instance that can.
- Instances created with high availability before PITR was offered on high availability cannot do it, and report
legacy. Restoring one produces a new instance that can, but on one node with no standby, for good (see PITR and failover). - An instance created with PITR switched off (
--no-pitron the CLI,pitr_enabled = falsein Terraform) can never be given it. Restoring it produces a new instance that can.
PITR and failover
On a highly available instance the window follows the pair across a failover: the node that takes over continues the same archive. You can restore to a moment before a failover, after it, or after several failovers. The restored instance keeps the high-availability setting but comes up on one node, with no standby (no_standby), so it has no failover protection, and a standby cannot be added to it later.
One limit: some log written just before a failover may never be archived — for example if synchronous replication was not armed at that moment (the HA status lags by up to about a minute, see What is guaranteed, and when), if the standby was short of disk space, or if the platform cannot confirm that archiving continued across the switch. Then moments before the failover can no longer be restored to, the same as after any other interruption in archiving, and a new window begins at the next base backup.
Turning it off, and back on
On an instance that is PITR-capable you can switch PITR off later — in the portal, or with pitr_enabled = false in Terraform. (fm has no instance update command.) Switching it off — or turning backups off, which closes it the same way:
- stops archiving within a few minutes, and the instance then keeps no restorable window — a point-in-time restore is refused;
- keeps the base backups and archived log already taken, and they stay billed until retention expires and they are reaped. Retention is a minimum of 35 days in immutable storage, so turning PITR off does not stop the charge immediately;
- starts a 24-hour cooldown. Turning PITR back on — or turning backups back on, which has the same effect — inside those 24 hours is refused, and the refusal names the time you may retry.
When you do turn it back on, the window starts again at the next base backup. It does not reach back across the interruption.
Base backups and the schedule
On a PITR instance the scheduled backup is a base backup: a physical copy that the archived log is replayed onto. It runs on your own backup schedule — there is no separate PITR cadence. On-demand backups you take yourself stay logical (full) and portable.
If you set no schedule, the platform picks one from the instance's storage size; larger volumes need longer between scheduled backups. If you set a schedule the platform cannot sustain at that size, the request is refused with a message naming the minimum interval for your size. Leave the portal's schedule field empty to mean "platform default for this size".
Resizing re-checks the schedule. If the platform chose the schedule, it re-picks one for the new size and reports it back. If you wrote the schedule yourself, a new size that no longer sustains it is refused — send a schedule that does in the same request (with Terraform; the portal's and fm's resize take only the size), and the resize and the new schedule take effect together.
A resize is refused while any backup is running. Wait for it to finish, then retry.
Restore time grows with the interval between base backups, because more log has to be replayed: roughly 16 seconds per GB to extract the base, plus roughly 2.3 hours for each busy day of log. Fetching from backup storage comes on top. In our measurements the base arrived faster than it could be extracted, so it added little, but the log is fetched one segment at a time, and backup storage served each in about 0.3 seconds, which adds at least an hour for each busy day of log. A daily base therefore takes at least three to four hours; a weekly one, a day or more. These fetch rates were measured while backup storage was lightly loaded; a restore that runs while it is busy may take longer.
When archiving pauses
Each tenant has a cap on how many bytes of PITR data it may retain at once. When a tenant reaches it, the platform stops accepting new log segments for that tenant's instances, and the instance reports archiving as paused with the reason tenant_cap — fm database postgres instance get prints "Archiving paused", and the API and Terraform carry the reason itself. The platform can also pause archiving fleet-wide during an incident, which shows as platform_disabled.
A capped tenant has no restore window
While a tenant is over the cap, its PITR instances have no restore window at all, and a point-in-time restore is refused. The window does not come back until the tenant is back under the cap.
Scheduled base backups keep running meanwhile. Each is a full copy of the volume and is retained and billed like any other, but none of them re-forms the window while the cap binds. Older base backups expire on their own retention clock, so a capped tenant gets back under the cap without intervention only when that expiry outpaces the new bases.
To recover sooner, turn PITR off on the instance producing the most log, make its backup schedule less frequent, or ask support to raise your tenant's cap.
Base backups in the backup list
Base backups appear in the backup list with type base, next to your full logical backups. They are managed by the platform: you cannot delete one — the request is refused — and you cannot create one on demand. They are removed automatically once a newer base supersedes them and retention has passed; a base that never became usable expires on its own retention clock.
PITR storage — base backups and archived log — is metered as the same database_backup line as your other managed-database backups. Prices come from the platform's pricing catalog and are shown in the portal; this guide doesn't quote amounts. See Billing.
Errors you may see
| Code | What it means | What to do |
|---|---|---|
pitr_unavailable_for_instance | This instance cannot do PITR. The reason says which: type (PostgreSQL only), legacy (created before PITR, created with it off, or a highly available instance created before PITR was offered on high availability), not_enabled (capable, but PITR or backups are currently off) | For not_enabled, turn PITR and backups on; the window starts at the next base backup. For legacy, restore to a new instance (a restore of a highly available instance comes up with no standby, for good). type cannot be changed on an existing instance, and a restore copies it. |
pitr_window_unavailable | There is no restore window — the first base backup is still running, a gap restarted it, or the tenant is over its cap | Check the window again later. Don't retry on a timer. |
pitr_out_of_window | The moment you asked for is outside the window. The error carries the window's bounds | Pick a moment inside the bounds it reports, and submit again. |
invalid_input | A backup and a point in time together, or neither; a base row given as a backup to restore from; PITR without backups; a schedule below the floor for the instance's size | Read the message — it names which. |
conflict | backup_running: a resize while a backup is running. pitr_cooldown: re-enabling inside the 24-hour cooldown, with the time you may retry. base_managed: deleting a base backup | Wait and retry, except for base_managed — base backups are not deletable. |
With Terraform
resource "frostmoln_postgres_instance" "app" {
# … create arguments as above …
backup_enabled = true
pitr_enabled = true
# backup_schedule left unset: the platform picks one for this storage size
}Full attribute reference: frostmoln_postgres_instance.
- Write
pitr_enabledexplicitly. The platform stamps it at create and the stamp is permanent, so an instance created without PITR can never be given it. Leave it out and you get whatever the platform resolves, which may be on — and billed. - The window attributes show as "known after apply" on any changing plan.
latest_restorable_timeadvances with every archived segment, so it is never the same at plan time and apply time. That is by design — quote the values, don't pin to them. restore_fromis create-only. Pointing it at a different source or instant replaces the resource, which destroys the restored database. Adding it to an instance that already exists is refused, and importing a restored instance records nothing.- Removing
restore_fromis not a no-op. It is a single in-place update that clears the record Terraform kept. Nothing changes on the platform, and the next plan is clean. - Terraform waits for a restore for at most
timeouts.create, which is 30 minutes by default. A point-in-time restore can take hours, and one from a weekly base a day or more (see the restore times above), so raisetimeouts.createon the resource before you apply. If the wait runs out first, the apply ends with a warning and the instance stays in state, possibly still restoring: check its status before you act on it. - The restore target is built from the source's own shape, so the source must be a PostgreSQL instance and
version,flavor_id,ha_enabled,vpc_idandsubnet_idmust equal the source's.storage_gbmay be larger, never smaller. Terraform reads the source first and refuses with the mismatch named, rather than quietly creating an empty database instead.
After a failed restore, refresh before you read the plan
A restore first creates the new instance, then applies the remaining differences (storage, backups, schedule, pitr_enabled) as one update. If that update fails, Terraform's state records what the plan asked for, not what the platform actually has — and the resource is deliberately not tainted, because tainting it would destroy the restored database on the next apply.
The divergence only surfaces on a refresh. terraform plan -refresh=false shows no difference at all. Run terraform plan (or terraform refresh) and apply the in-place update it then reports.
PostgreSQL extensions
PostgreSQL instances can enable extensions from the platform's extension catalog — TimescaleDB, pg_stat_statements, pg_trgm, pgcrypto and unaccent today, more as the catalog grows. An extension is enabled or disabled in every database on the instance at once, and databases you create later inherit the enabled ones. The preload-required ones (TimescaleDB, pg_stat_statements) pay a restart window, and the platform runs one operation at a time. See PostgreSQL extensions.
Locales and collation
Managed PostgreSQL has only the C, POSIX and C.UTF-8 operating-system (libc) locales — deliberately. For language-aware sorting and comparison use the ICU collations, which are all available as en-US-x-icu, sv-SE-x-icu, de-DE-x-icu and so on (in ICU_LOCALE you give just the tag, such as 'en-US'). libc sort rules come from the operating system and can change when it is upgraded, leaving indexes on text columns inconsistent. Each ICU collation carries a version that PostgreSQL records, so it warns when the version changes and the affected indexes can be rebuilt.
List the ICU collations:
SELECT collname FROM pg_collation WHERE collprovider = 'i';Importing a dump from another provider
Databases elsewhere often use a libc locale such as en_US.UTF-8 (the default on Amazon RDS and Aurora, for example). Recreating such a database here fails with invalid LC_COLLATE locale name — whether through pg_dump --create, pg_dumpall or a CREATE DATABASE ... LOCALE 'en_US.UTF-8'.
If plain byte-order sorting is fine for you, a plain CREATE DATABASE app; accepts the dump as it is (unless columns use an explicit COLLATE, see below). For language-aware sorting, create the database with an ICU locale instead (PostgreSQL 15 and later):
CREATE DATABASE app
LOCALE_PROVIDER icu ICU_LOCALE 'en-US'
LOCALE 'C.UTF-8'
TEMPLATE template0;TEMPLATE template0 is required: PostgreSQL lets you change the locale provider or collation only when copying template0, because other templates may already contain indexes sorted under their own collation. LOCALE 'C.UTF-8' fills the libc settings that PostgreSQL still needs alongside ICU.
A database created from template0 does not inherit enabled extensions. Enable the extensions you need through the platform (see PostgreSQL extensions) after creating the database and before restoring; the dump's CREATE EXTENSION statements then have nothing left to do.
Then restore into it:
pg_dump: dump without--create, and with--no-owner --no-privilegesso the dump does not refer to roles that only exist at the old provider. Restore into the database you created, for examplepsql "host=<host> user=pgadmin dbname=app" -f app.sql(orpg_restore --no-owner --no-privilegeswithout--create).pg_dumpall: edit eachCREATE DATABASEline in the file to the form above before you restore it.- Explicit collations: a column or index declared with
COLLATE "en_US.utf8"fails too, withcollation "en_US.utf8" for encoding "UTF8" does not exist. Change it to the ICU equivalent, such asCOLLATE "en-US-x-icu".
PostgreSQL 14 has no LOCALE_PROVIDER for databases: use a plain CREATE DATABASE app; and ICU collations per column, or create a new instance on a newer version and migrate.
Stop, start and restart
fm database postgres instance stop <instance-id>
fm database postgres instance start <instance-id>
fm database postgres instance restart <instance-id>- Stop shuts the server down cleanly. The instance shows
stopping, thenstopped. Compute is not charged while it is stopped; point-in-time recovery storage is. - Start boots a stopped instance:
starting, thenrunning, at the same address with the same data. - Restart reboots a running instance:
restarting, thenrunning. Every connection is dropped while it reboots; clients should reconnect. - Each takes a minute or two.
fmwaits for the instance to settle; pass--no-waitto return as soon as the action is accepted. If an action fails, the instance showserror. Contact support, who can retry it. - High availability: a high-availability instance cannot be stopped yet (restart works). Nothing can be stopped or restarted during a failover, a running backup, or a credential rotation. Wait for it to finish, then retry.
- Read replicas keep running while their primary is stopped, and catch up when it starts again.
Lifecycle and limits
- Versions are fixed for the life of an instance — in-place upgrades are not yet available. To move to a newer major version, create a new instance on that version and migrate your data (e.g. with
pg_dump/mysqldump). - High availability is fixed for the life of an instance — it is chosen at create time and cannot be added or removed later (see above).
- Require TLS is fixed for the life of an instance, and an instance created without a certificate never gets one (see Instances without TLS).
- Deletion is permanent and removes the storage volume (see above).
- An instance lives in one VPC/subnet (one region).
Related
- PostgreSQL extensions
- Network: VPCs · Security Groups
- Object Storage (somewhere to keep your dumps)
- Caches · Billing