Managed PostgreSQL 19 is now available on Appwrite Cloud_
New Appwrite managed PostgreSQL databases now run PostgreSQL 19, and existing PostgreSQL 17 and 18 databases upgrade to it online from the Console or API.

PostgreSQL ships one major version a year, and each release brings planner, maintenance, and SQL improvements that you only get by moving to it. On a database you run yourself, moving is the hard part. A major version upgrade has traditionally meant a pg_dump and restore, or pg_upgrade with the database offline, so teams put it off and drift a version or two behind.
The PostgreSQL Global Development Group released PostgreSQL 19 on November 19. Today, we are announcing PostgreSQL 19 for Appwrite managed PostgreSQL databases, available on Appwrite Cloud now.
What PostgreSQL 19 on Appwrite gives you
- PostgreSQL 19 by default. New managed PostgreSQL databases run PostgreSQL 19 unless you pass a different
versionwhen you create them. - Upgrades from the Console. A new Version card under Settings > General lists every newer supported version with an Upgrade button. Until now, upgrades were only available through the API.
- The same upgrade through the API.
createUpgradewithtargetVersionset to'19'runs the same online upgrade from a Server SDK or a script. - Reads and writes continue during the copy. Your data streams to a new instance with logical replication while the current one keeps serving traffic. Queries pause only at the cutover, when connections close.
- PostgreSQL 17 and 18 stay supported. Existing databases keep their version until you upgrade them, and you can still create a database on 18 or 17.
Create a PostgreSQL 19 database
New databases get PostgreSQL 19 with no extra step:
- In your project, go to Databases and click Create database.
- Under Choose database type, select PostgreSQL from the Native databases group.
- Under Name your database, keep the generated name or enter your own, then pick a tier under Specifications. Review the summary and click Create database.
Once the database reports ready, connect with psql or the SQL editor in the Console and confirm the version:
SHOW server_version;
Upgrade an existing database to PostgreSQL 19
Databases created on PostgreSQL 17 or 18 can upgrade to 19 online. The database keeps running on its current version until you start the upgrade.
Upgrade from the Console
- Open the database and go to Settings > General.
- In the Version card, click Upgrade next to PostgreSQL 19.
- Read the notes in the dialog and click Upgrade to confirm.
The database moves to the upgrading state, and the Console shows a Database is upgrading banner at the top of the database's pages. The status returns to ready once the cutover is done.
Upgrade with a Server SDK
Call createUpgrade with the database ID and the target version:
import { Client, Postgresql } from 'node-appwrite';
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
.setProject('<PROJECT_ID>')
.setKey('<YOUR_API_KEY>');
const postgresql = new Postgresql(client);
await postgresql.createUpgrade({
databaseId: '<DATABASE_ID>',
targetVersion: '19',
});
import { Client, Postgresql } from "npm:node-appwrite";
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
.setProject('<PROJECT_ID>')
.setKey('<YOUR_API_KEY>');
const postgresql = new Postgresql(client);
await postgresql.createUpgrade({
databaseId: '<DATABASE_ID>',
targetVersion: '19',
});
<?php
use Appwrite\Client;
use Appwrite\Services\Postgresql;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
->setProject('<PROJECT_ID>')
->setKey('<YOUR_API_KEY>');
$postgresql = new Postgresql($client);
$postgresql->createUpgrade(
databaseId: '<DATABASE_ID>',
targetVersion: '19',
);
from appwrite.client import Client
from appwrite.services.postgresql import Postgresql
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1')
client.set_project('<PROJECT_ID>')
client.set_key('<YOUR_API_KEY>')
postgresql = Postgresql(client)
postgresql.create_upgrade(
database_id='<DATABASE_ID>',
target_version='19',
)
require 'appwrite'
include Appwrite
client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1')
.set_project('<PROJECT_ID>')
.set_key('<YOUR_API_KEY>')
postgresql = Postgresql.new(client)
postgresql.create_upgrade(
database_id: '<DATABASE_ID>',
target_version: '19',
)
using Appwrite;
using Appwrite.Services;
Client client = new Client()
.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.SetProject("<PROJECT_ID>")
.SetKey("<YOUR_API_KEY>");
Postgresql postgresql = new Postgresql(client);
await postgresql.CreateUpgrade(
databaseId: "<DATABASE_ID>",
targetVersion: "19"
);
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
.setProject('<PROJECT_ID>')
.setKey('<YOUR_API_KEY>');
Postgresql postgresql = Postgresql(client);
await postgresql.createUpgrade(
databaseId: '<DATABASE_ID>',
targetVersion: '19',
);
import io.appwrite.Client
import io.appwrite.services.Postgresql
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.setProject("<PROJECT_ID>")
.setKey("<YOUR_API_KEY>")
val postgresql = Postgresql(client)
postgresql.createUpgrade(
databaseId = "<DATABASE_ID>",
targetVersion = "19",
)
import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.setProject("<PROJECT_ID>")
.setKey("<YOUR_API_KEY>")
let postgresql = Postgresql(client)
_ = try await postgresql.createUpgrade(
databaseId: "<DATABASE_ID>",
targetVersion: "19"
)
package main
import (
"github.com/appwrite/sdk-for-go/v7/appwrite"
)
func main() {
client := appwrite.NewClient(
appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"),
appwrite.WithProject("<PROJECT_ID>"),
appwrite.WithKey("<YOUR_API_KEY>"),
)
service := appwrite.NewPostgresql(client)
_, err := service.CreateUpgrade("<DATABASE_ID>", "19")
if err != nil {
panic(err)
}
}
use appwrite::client::Client;
use appwrite::services::postgresql::Postgresql;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new()
.set_endpoint("https://<REGION>.cloud.appwrite.io/v1")
.set_project("<PROJECT_ID>")
.set_key("<YOUR_API_KEY>");
let postgresql = Postgresql::new(&client);
postgresql.create_upgrade("<DATABASE_ID>", "19").await?;
Ok(())
}
curl -X POST \
-H "X-Appwrite-Project: <PROJECT_ID>" \
-H "X-Appwrite-Key: <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"targetVersion": "19"
}' \
https://<REGION>.cloud.appwrite.io/v1/postgresql/<DATABASE_ID>/upgrades
How the online upgrade works
An upgrade doesn't modify the instance that serves your traffic. Appwrite provisions a second instance on PostgreSQL 19 with the same specification and storage, streams your data into it with logical replication, and waits for replication to catch up. Reads and writes continue on the current instance during the copy.
At the cutover, the old instance is fenced read-only, its client connections are closed, and new connections are refused until traffic moves to the new instance. Queries pause for that moment, and your application has to reconnect. The hostname and credentials don't change, so a connection pool that retries dropped connections handles this without code changes. Because connections close, start the upgrade during a low-traffic period.
If the new instance can't catch up, Appwrite cancels the cutover and the current instance keeps serving. The database must be ready to start an upgrade, the target version must be newer than the current one, and an upgrade can't be reversed.
What's new in PostgreSQL 19
PostgreSQL 19 adds new SQL for get-or-create writes, an online way to reclaim table bloat, and faster foreign key checks, alongside planner, replication, and monitoring work. The PostgreSQL 19 release notes cover all of it. These are the changes application developers are likely to notice first.
Get-or-create with ON CONFLICT DO SELECT
INSERT ... ON CONFLICT DO NOTHING skips a conflicting row and returns nothing for it. Get-or-create code usually follows it with a second SELECT, or uses a no-op DO UPDATE that writes a new row version just to get the row back. PostgreSQL 19 adds DO SELECT, which returns the existing row through RETURNING:
INSERT INTO tags (slug, name)
VALUES ('postgres', 'Postgres')
ON CONFLICT (slug) DO SELECT
RETURNING id, slug, name;
One statement returns the row whether it was just inserted or already existed. DO SELECT requires a conflict target and a RETURNING clause, and DO SELECT FOR UPDATE also locks the existing row against concurrent updates.
Online table repacking with REPACK
Tables with heavy updates and deletes accumulate dead space. Autovacuum marks that space for reuse, but it doesn't shrink the table. Reclaiming it used to mean VACUUM FULL or CLUSTER, which lock the table while they run.
PostgreSQL 19 adds the REPACK command. REPACK (CONCURRENTLY) rewrites a table while reads and writes continue, and takes an exclusive lock only for its final phase. The concurrent mode needs a primary key or an index-based replica identity on the table, and it can't run inside a transaction block. VACUUM FULL and CLUSTER remain available.
Faster bulk inserts with foreign keys
PostgreSQL 19 speeds up foreign key checks, which in the PostgreSQL project's testing made bulk inserts nearly 2x faster. There is nothing to turn on. Imports and batch writes into tables with foreign keys benefit as soon as the database runs PostgreSQL 19.
Behavior changes to check before you upgrade
A few behaviors changed in ways application code can notice:
json_array()over zero rows now returns an empty JSON array instead ofNULL. Code that checks forNULLthere needs updating.standard_conforming_stringscan no longer be turned off, so backslashes in ordinary string literals are always literal characters. UseE'...'strings for escape sequences.- MD5 passwords now produce a warning after each successful login, and MD5 support will be removed in a future PostgreSQL release. Move roles that use MD5 to SCRAM-SHA-256 passwords.
The maintenance docs keep this list next to the upgrade steps.
When to move to PostgreSQL 19
The right time depends on where your database is today:
- New projects. Create the database and you are on PostgreSQL 19. Start on an older version only if a dependency requires it.
- Existing databases on 17 or 18. Create a new PostgreSQL 19 database, run your migrations and test suite against it, then upgrade production. Take a manual backup right before you start, so you have a recent restore point.
- Databases that depend on a specific extension. Check that each installed extension supports PostgreSQL 19 before you upgrade. pgvector, PostGIS, and pg_trgm are already in the PostgreSQL 19 extension catalog. If one you need isn't yet, stay on your current version. Nothing changes until you start an upgrade.
Upgrades are one-way, so test first. Once your application passes against PostgreSQL 19, the upgrade itself is a single click or API call.
Get started with PostgreSQL 19 on Appwrite
PostgreSQL 19 is available on Appwrite Cloud today. Create a new database to start on it, or open Settings > General on an existing one to upgrade. If you are new to managed PostgreSQL on Appwrite, the launch post covers connections, backups, branches, and high availability.
Yes. Appwrite Cloud supports PostgreSQL 19 for managed PostgreSQL databases, and new databases run it by default. PostgreSQL 18 and 17 are also supported. See supported versions.
In the Console, open the database's Settings > General, click Upgrade next to PostgreSQL 19 in the Version card, and confirm. From a Server SDK, call createUpgrade with targetVersion set to '19'. See engine version upgrades.
Your database keeps serving reads and writes while your data copies to the new instance. At the cutover, the old instance is fenced read-only and open connections are closed, so queries pause for a moment and your application has to reconnect. The hostname and credentials stay the same.
No. An upgrade can't be reversed, so take a manual backup and test your application against a PostgreSQL 19 database before you upgrade production.
Yes. New databases default to PostgreSQL 19, but you can pass version as '18' or '17' when you create a database through the API. Existing databases stay on their current version until you upgrade them.
Only if it depends on one of the behavior changes in PostgreSQL 19: json_array() over zero rows now returns an empty array instead of NULL, standard_conforming_strings is always on, and MD5 password logins now raise a warning. Also confirm that your installed extensions support PostgreSQL 19.





