NEW RasterizedDB 1.1.0 is out: sharding and the gateway, the message broker, roles and row-level security, compression, .NET on NuGet, and the enterprise edition. What's new ›

Upgrading

This page explains how to move a server to a newer release, what happens to the data directory, and which release notes require action from you. Read the section for the version you are moving to before you start.

Release channels

RasterizedDB is released through three tags, each with its own version:

TagWhat it releasesWhere it goes
v<version>The server executables, the gateway, the enterprise edition, Studio, the Docker images and the Arch packageGitHub releases, Docker Hub, ghcr.io
server-v<version>The rasterizeddb_core and rasterizeddb_embedded cratescrates.io
client-v<version>The rasterizeddb_client cratecrates.io

The current releases are server 1.1.0, rasterizeddb_client 1.1.0 and rasterizeddb_embedded 1.1.1. The .NET packages (RasterizedDb.Data, RasterizedDb.EntityFrameworkCore, RasterizedDb.Messaging) are on NuGet at 1.1.0. The main branch holds the latest release and dev the work for the next one. A pre-release tag such as v1.1.0-rc.1 is a release candidate: it is published as a GitHub pre-release, and its Docker images get only their exact tags, never latest.

What stays compatible between server releases is its command-line flags, its wire protocols and its SQL. The rasterizeddb_core crate's Rust API is the server's internals and does not follow semantic versioning; applications should use rasterizeddb_client or rasterizeddb_embedded, which do.

Upgrading a server

A newer server opens the data directory of an older one as it is. There is no separate migration step.

  1. Take a backup. With S3 backup on, BACKUP DATABASE takes a snapshot now; otherwise stop the server and copy the data directory. See Backup and restore.
  2. Read the upgrade notes below for every version between yours and the new one.
  3. Stop the server cleanly (SIGTERM, systemctl stop, docker stop -t 60). A clean stop checkpoints the log, so the new version starts without a replay. See Stopping the server.
  4. Replace the executable with the new release's, keeping the same flags and data directory.
  5. Start it and check the log with --log-level info, or connect and run SELECT version();, which answers rasterizeddb (pgwire) <version>.

With the Arch package, sudo pacman -U the new package and sudo systemctl restart rasterizeddb.

With Docker, pull the new tag and recreate the container on the same volume:

sh
docker pull milendenev/rasterizeddb:1.1.0
docker stop -t 60 rasterizeddb
docker rm rasterizeddb
docker run -d --name rasterizeddb \
  -e RASTERIZEDDB_PG_PASSWORD=change-me \
  -p 5432:5432 -p 61170:61170 \
  -v rasterizeddb:/var/lib/rasterizeddb \
  milendenev/rasterizeddb:1.1.0

With Compose, change the image: tag and run docker compose up -d.

Replicating clusters

Upgrade one node at a time: the nodes that receive transactions first, and the node taking writes last. A newer node can replicate a statement form an older one cannot parse, so a statement that needs the new release must not run until every node has it. See Replication.

Downgrading

A newer server may write on-disk formats an older one cannot read correctly. When it first does, it records the format in a file named incompat_features in the database's directory. A server that does not know a format named there refuses to open the directory before touching anything:

text
it uses on-disk features this binary does not support: composite_foreign_key_v1 (...). Opening it would read or write files this binary cannot keep correct; use a build that supports them

Do not edit that file to get past this. Downgrade by restoring a backup taken before the upgrade.

FormatWritten whenRefused by
index_store_v1Index snapshots are first written, at a clean shutdown or an idle checkpointbuilds without the persistent_indexes feature
numeric_own_scale_v1An unconstrained NUMERIC column first stores a value at its own scalebuilds before 1.0.0
composite_foreign_key_v1The first foreign key over several columns is created1.0.0
compressed_values_v1The first value is stored in a column declared COMPRESSION1.0.1 and earlier, and builds without storage_compression
shard_v1The directory is started as a shard of a sharded clusterbuilds without the sharding feature
ledger_v1The first ledger table is createdthe GPL server and builds before 1.1.0
encrypted_values_v1The first encrypted column is createdthe GPL server and builds before 1.1.0
vault_v1A secret vault is first createdthe GPL server and builds before 1.1.0

The last three are written only by the enterprise edition.

Upgrade notes

1.1.0

  • A native client on a trust socket must name its role. A native connection under trust that names no role is no longer an administrator. In a database with roles, a Login::Trust connection on a --rdb-socket-auth trust socket now runs as no role: role statements, server administration (BACKUP, STORAGE, CREATE DATABASE and the like) and the tables other roles own are refused. It keeps the tables it created and what PUBLIC is granted. Applications that relied on it change Client::connect to Client::connect_as_role(addr, options, "rasterized") (rasterizeddb_client 1.1.0), naming the role they should run as. A database with no roles at all is unchanged. See Security.
  • No downgrade after a compressed value. The first value stored in a COMPRESSION column adds compressed_values_v1, and an older build refuses the directory.
  • SQL Server protocol: text columns are case-insensitive by default. A CREATE TABLE or ADD COLUMN over the SQL Server protocol without a COLLATE now gives a case-insensitive column. Start with --mssql-collation bin to keep byte comparison. Tables created over PostgreSQL, MySQL or the native protocol are unchanged, and so are existing tables.

1.0.1

  • Replicating clusters: upgrade the receiving nodes first and the node taking writes last. Every node must run 1.0.1 before any of these happen anywhere in the cluster:

    • CREATE UNIQUE INDEX (1.0.0 cannot parse the form 1.0.1 replicates);
    • writes to the key/value cache on a replicating node;
    • replicating a database other than the default one.

    A database that existed before replication was turned on still needs a base copy (a restore) on each node.

  • Check tables replicated by 1.0.0 that use non-deterministic defaults (gen_random_uuid(), now() and the like). Under 1.0.0 the nodes may have stored different values for the same row. Compare them with SELECT … ORDER BY on each node, and copy any table that differs again from one node.

  • No downgrade after a composite foreign key. The first foreign key over several columns adds composite_foreign_key_v1, and 1.0.0 refuses the directory.

  • CREATE UNIQUE INDEX after a downgrade. 1.0.0 reads indexes made this way as unique constraints, so DROP INDEX on them is refused again there.

  • Behaviour changes to check in your application:

    • errors on partitioned tables carry SQLSTATE 42P16 where XX000 or 0A000 was returned before;
    • a second primary key fails with 42P16;
    • set operations mixing a date column with a timestamp, a string constant in a first branch beside a typed later branch, and a regtype sort key in grouped, DISTINCT or set queries are refused with 0A000 and a message naming the cast to add;
    • an unnamed CHECK constraint is now named as PostgreSQL names it (<table>_<column>_check, or <table>_check), not <table>_check1; existing tables keep their names;
    • an UPDATE matching no rows no longer fails a CHECK its constant SET would break.
  • Rust applications on rasterizeddb_core: its API changed. Move to rasterizeddb_embedded or rasterizeddb_client.

1.0.0

The first stable release. It has no upgrade notes of its own.

Limits

  • Downgrading is only possible while the newer server has not written a format the older one refuses. Keep a backup from before every upgrade.
  • There is no in-place upgrade of a running server; each node restarts.
✓ page rendered in 157 µs axum + tera + htmx · no other javascript