# Compatibility

> Committed and Beta features, unsupported Redis features, differences and test results.

---

LLMS index: [llms.txt](/llms.txt)

---

pgredis 0.1.0 (extension schema `0.54`, ABI `3`) targets Redis 7.2.4 standalone semantics with PostgreSQL 18 as the only persistent store. It is not a drop-in replacement for every Redis deployment. This page defines the support tiers, behavioral differences and source-bound test results.

## Feature scope and support tiers {#scope}

### Committed {#supported}

Committed features are covered by release-candidate regression checks:

| Category | Scope |
| --- | --- |
| Data types | String, Hash, Set, ZSet and List, including blocking pops (`BLPOP`, `BRPOP`, `BLMOVE`, `BRPOPLPUSH`, `BLMPOP`, `BZPOPMIN`, `BZPOPMAX`, `BZMPOP`) |
| Keyspace | TTL and expiry, `SCAN`, `SELECT` (logical databases `0`–`15`), `DEL`, `EXISTS`, `TYPE`, `RENAME`, `COPY` |
| Transactions | `MULTI`, `EXEC`, `DISCARD`, `WATCH` |
| Publish/Subscribe | Channels, pattern subscriptions and sharded Pub/Sub (`SSUBSCRIBE`, `SPUBLISH`) |
| Administration | Subsets of `INFO`, `CONFIG` and `CLIENT` |
| SQL API | `redis.command(text[], integer)` and `redis.command_bin(bytea[], integer)` in the same transaction as SQL tables |
| Authentication | Native PostgreSQL role mode (`AUTH` maps to a `LOGIN` role; permissions enforced by extension entry points) |
| Transport | RESP2 and RESP3; mandatory TLS on non-loopback listen addresses |
| Durability | `synchronous_commit = on` by default; the gateway replies only after PostgreSQL confirms commit |

### Beta {#beta}

Beta features are included in `0.1.0` without a stability commitment; options and edge cases may change in later versions:

- Streams and consumer groups (`XADD`, `XREAD`, `XREADGROUP`, `XACK`, `XCLAIM`, `XAUTOCLAIM`, `XINFO`).
- Bitmap, HyperLogLog and Geo commands.
- `DUMP`, `RESTORE` and `MIGRATE`.
- Client-side caching (`CLIENT TRACKING`, `CLIENT CACHING`, `CLIENT GETREDIR`, `CLIENT TRACKINGINFO`).
- `MONITOR`.
- Redis ACL compatibility mode (`-auth-mode redis-acl`).

### Unsupported {#unsupported}

| Area | Behavior and impact |
| --- | --- |
| Lua scripting and Functions | `EVAL`, `EVALSHA`, `FUNCTION` and `FCALL` return an unknown-command error. Frameworks that call Lua in their default configuration do not work out of the box: Celery 5.6.3 / Kombu 5.6.2 calls `EVALSHA` during startup maintenance even on an empty broker, and Sidekiq 8.1.7 uses Lua in its default scheduled-job poller. The default `redis-py` lock acquires with `SET NX PX` and releases with `EVALSHA`; only TTL expiry works without Lua |
| Cluster and Sentinel | `CLUSTER` and `SENTINEL` commands are not implemented |
| Redis replication | `REPLICAOF`, `SLAVEOF`, `SYNC` and `PSYNC` are rejected. `WAIT` returns `0` replica acknowledgements and does not measure PostgreSQL WAL or standby state; use PostgreSQL replication for high availability |
| Redis persistence files | AOF and RDB files, `SAVE`, `BGSAVE`, `BGREWRITEAOF`, `WAITAOF` (`numlocal=1`) and `DEBUG RELOAD` are not supported; use PostgreSQL backup and recovery tools |
| Memory eviction | `maxmemory` eviction policies are not implemented |
| Modules | `MODULE` load/unload commands and Redis modules are not supported (`MODULE LIST` returns an empty list) |
| Multi-gateway | Running multiple gateway processes against one PostgreSQL database is not verified |
| Redis 7.4+ commands | Commands introduced after Redis 7.2.4 (such as Hash field expiry `HEXPIRE`) are not implemented |
| Exactly-once delivery | When a commit outcome is unknown, the gateway closes the connection without replaying the command. Client libraries or frameworks that auto-retry on disconnect (including default producer retries in RQ, Sidekiq, Celery and Lettuce) can write duplicate items; deduplicate by business ID |

## Authentication and databases {#identity}

Each `pgredis` gateway process connects to one PostgreSQL database. Redis `SELECT` switches among logical databases `0` through `15` inside that PostgreSQL database. Logical databases share the same PostgreSQL tables and do not provide tenant isolation; use separate PostgreSQL databases for tenant boundaries.

In the default `native` authentication mode, `AUTH` and `HELLO ... AUTH` verify PostgreSQL `LOGIN` credentials and PostgreSQL `GRANT` privileges control read, write and administrative entry points. In `redis-acl` mode (`-auth-mode redis-acl`), the gateway authenticates Redis ACL users and filters commands, key patterns and Pub/Sub channels, while the gateway's PostgreSQL connection role remains the outer permission ceiling.

## Data and transactions {#transactions}

Both the RESP gateway and SQL functions (`redis.command`, `redis.command_bin`) execute the same C command handlers in `pg_redis`. Every standalone RESP command runs in one PostgreSQL transaction and sends its reply only after commit.

Direct SQL calls join the caller's transaction (`READ COMMITTED` only), so SQL table writes, Redis key mutations and queued notifications commit or roll back together. Inside `MULTI`/`EXEC`, the gateway queues commands in memory and submits the batch in a single PostgreSQL transaction on `EXEC`:

- A Redis command error (such as `WRONGTYPE` or syntax errors) is recorded as an error element in the `EXEC` reply array, and the remaining commands in the batch still execute and commit.
- A PostgreSQL system error (such as serialization failure, lock timeout or out-of-memory) aborts and rolls back the entire `EXEC` transaction.

## Per-database serialization {#serialization}

Write commands other than plain `GET` and plain `SET` (without extra options) acquire a per-database exclusive lock and hold it until the PostgreSQL transaction commits, including the WAL flush. Writes to different keys in the same database therefore wait in line, and write throughput is bounded by the commit rate of the underlying storage. Plain `GET` and plain `SET` take a database shared lock plus a per-key lock and are not serialized across distinct keys.

This lock preserves cross-database invariants for shared objects and fixes the lock order for blocking handoffs, `WATCH`, notifications and `CLIENT PAUSE`. Removing it requires a full concurrency audit and is deferred beyond `0.1.0`.

Measured on candidate `v0.1.0-rc1` (commit `11411411d72ab45456904cc602cefbb13b68ff25`, 2026-11-08, Linux container on AMD Ryzen AI MAX+ 395, 4 CPUs, 2 GiB RAM, no swap, PostgreSQL 18.6, `fdatasync` ~0.19 ms, `redis-benchmark` from Redis 7.2.4 with 50 clients, no pipelining, 10,000 random keys for `SET`/`GET`, 128-byte values, 50,000 requests, gateway pool size 4):

| Workload | `synchronous_commit=on` | `synchronous_commit=off` |
| --- | --- | --- |
| `SET` (random keys) | 8,423 req/s, p50 5.215 ms | 20,056 req/s, p50 1.527 ms |
| `GET` (random keys) | 29,833 req/s, p50 0.807 ms | 32,787 req/s, p50 0.775 ms |
| `INCR` (one hot key) | 2,469 req/s, p50 19.2 ms | 6,207 req/s, p50 7.0 ms |
| `LPUSH` (one hot key, growing to 50,000 items) | 2,057 req/s, p50 23.6 ms | 4,902 req/s, p50 9.4 ms |

On storage with slower WAL flushes, latency increases proportionally: on a host with `fdatasync` around 20 ms, a mixed workload with `synchronous_commit=on` measured a p50 of 477 ms. Check disk flush latency with `pg_test_fsync` before deployment.

## Object metadata and List encoding {#object-metadata}

Starting in extension schema `0.54`, two Redis object-fidelity features are disabled by default so reads do not write WAL and list appends do not rewrite full layout metadata:

- **Access heat tracking (`pg_redis.object_heat_tracking = off` by default):**
  - Reading a key does not update LRU/LFU metadata. A plain `GET` writes no WAL and does not wait for a WAL flush under `synchronous_commit = on`.
  - `OBJECT IDLETIME` returns an explicit error stating that object access tracking is disabled.
  - `OBJECT FREQ` returns the same error when an LFU policy is selected, or the standard Redis error when a non-LFU policy is active.
  - `DEBUG OBJECT` reports only the `lru` timestamp recorded when the key was created, replaced or restored.
- **List layout tracking (`pg_redis.list_layout_tracking = off` by default):**
  - `LPUSH`, `RPUSH` and `LLEN` use the `redis._list_length` cache added in schema `0.54`; append cost stays flat as the list grows (in `0.53`, single-hot-key `LPUSH` was 64.6 req/s in the same benchmark environment).
  - `OBJECT ENCODING` and `DEBUG OBJECT` estimate `listpack` versus `quicklist` from current elements using `list-max-listpack-size`, without modeling hysteresis after a list shrinks.
  - `MEMORY USAGE` omits list-layout metadata bytes.
  - Lists that had recorded layout history before turning the setting off drop that history on their next write; re-enabling `pg_redis.list_layout_tracking` later causes `OBJECT ENCODING` on those lists to return an unavailable-history error until the key is recreated.

## Client-side caching {#tracking}

`CLIENT TRACKING`, `CLIENT CACHING`, `CLIENT GETREDIR` and `CLIENT TRACKINGINFO` support default tracking, `BCAST` with `PREFIX`, `OPTIN`, `OPTOUT`, `NOLOOP` and client-ID redirection:

- RESP3 connections receive invalidation pushes on the same connection or a redirected RESP3 connection; RESP2 connections receive invalidation messages on `__redis__:invalidate` through a redirected connection subscribed to that channel.
- Default tracking sends one single-element key array per invalidated key (even when `MSET` modifies multiple keys); `BCAST` groups keys by registered prefix, and a full-cache flush sends a null payload.
- SQL writes and tracking invalidations commit or roll back together in the same PostgreSQL transaction.
- `CONFIG GET/SET tracking-table-max-keys` bounds distinct tracked keys across logical databases (default `1,000,000`). Trimming happens synchronously inside the transaction that lowers the limit or completes a tracked read. If the notification queue or tracking index overflows, pgredis invalidates the full cache or closes the lagging recipient connection.

## Binary data and size limits {#binary}

Keys, values, hash fields, set members, sorted-set members, stream entries and Pub/Sub channel names are stored as `bytea` and preserve arbitrary byte sequences, including embedded `NUL` (`\x00`) bytes. Sorted sets order members with equal scores by raw byte comparison (`memcmp`).

The maximum single command argument size is `512 MiB`. On commit `715827aa0` (Linux arm64, 2026-10-21, 8 GiB container), `SET`, `GET`, `SET GET` and `GETSET` with 512 MiB binary values passed under default gateway and extension memory budgets across both authentication modes and RESP2/RESP3.

## Disconnects and unknown outcomes {#failure}

If a connection drops, times out or fails during commit or pool reset after a command has been sent to PostgreSQL, the commit outcome may be unknown. The gateway never replays a command whose outcome is uncertain; it closes the client connection or returns an explicit unknown-outcome error.

A PostgreSQL or gateway restart terminates active network sessions, clearing `WATCH` registrations, blocked waits and Pub/Sub or tracking routes. PostgreSQL crash recovery restores committed table data and TTL deadlines, not transient network state.

## MIGRATE {#migration}

`MIGRATE` is supported for standalone gateway calls (including binary keys, core data types, TTL, `COPY`, `REPLACE`, `AUTH`, `AUTH2` and `KEYS`):

- The extension checks permissions, locks source keys and serializes payloads in one SQL transaction; the gateway opens a TCP connection to the target and verifies `AUTH`, `SELECT` and `RESTORE` replies before deleting migrated source keys.
- If a network failure or timeout occurs after the target accepts `RESTORE` or while the source commit is in flight, the target may already hold a copy while the source key remains. The gateway never replays `MIGRATE` or deletes target keys to compensate for a source rollback.
- Calling `MIGRATE` inside `MULTI`/`EXEC` or through direct SQL returns `NOKEY` when all named source keys are missing, and returns an explicit scope error when any source key exists because remote network writes cannot roll back with a PostgreSQL transaction.
- On commit `715827aa0` (Linux arm64, 2026-10-21), `MIGRATE` between two pgredis gateways backed by separate PostgreSQL databases passed 96 cases across 8 auth/protocol combinations; gateways sharing the same PostgreSQL database time out due to database-level locking.

## MONITOR {#monitor}

`MONITOR` streams command observations from the current PostgreSQL database over RESP2 or RESP3:

- Records become visible only after the outer PostgreSQL transaction commits; rolled-back transactions and rolled-back savepoints emit no `MONITOR` records.
- Complete binary arguments are preserved with control bytes escaped, while passwords in `AUTH`, `HELLO ... AUTH` and `MIGRATE ... AUTH/AUTH2` are redacted.
- Each database maintains a volatile ring buffer capped at `4 MiB` and `4,096` entries. If an observer falls behind and unread entries are overwritten, or if permissions are revoked or `PREPARE TRANSACTION` runs on a monitored session, the gateway closes the `MONITOR` connection so the caller detects the gap. `MONITOR` is not a persistent audit log.

## Test results and delivery stages {#testing}

### Headline test results {#test-results}

The release regression on `v0.1.0-rc1` (packages from `11411411d`, recorded 2026-11-08) is on the [Status](/docs/redis/status/#verified) page: seven-client smoke 338/338, core differential all pass, outbox 46/46 per profile, new installation and `0.52` → `0.54` upgrade pass, and the official subset (20 files, native RESP2, out-of-scope tags excluded) 1,090 pass, 6 fail, 4 files stopped early.

The full matrices below were not run on `v0.1.0-rc1`. Each result is bound to the commit, platform and date in the table:

| Suite | Build and platform | Date | Result |
| --- | --- | --- | --- |
| Official Redis 7.2.4 server matrix (39 files × RESP2/RESP3 = 78 profiles, Redis ACL) | `715827aa0`, Linux arm64, PG 18.6 | 2026-10-21 | 2,311 pass / 35 fail / 48 abort / 4 filtered (2,312 / 34 / 48 / 4 in the 2026-10-22 run on `3d319b780`) |
| Official Redis 7.2.4 external matrix (39 files × native/ACL × RESP2/RESP3 = 156 profiles) | `715827aa0`, Linux arm64, PG 18.6 | 2026-10-21 | 3,936 pass / 56 fail / 64 abort / 28 filtered (plus 28 zero-invocation profiles) |
| Core SQL/RESP differential suite (4 RESP + 2 SQL profiles) | `715827aa0`, Linux arm64, PG 18.6 | 2026-10-21 | 5,187 cases per RESP profile and 5,151 cases per SQL profile; all pass |
| Seven-client smoke (`redis-cli`, `redis-py`, `go-redis`, `ioredis`, `Jedis`, `Lettuce`, `StackExchange.Redis`) | `715827aa0`, Linux arm64, PG 18.6 | 2026-10-21 | 169 core checks per auth mode (338/338 pass; `ioredis` RESP2 only) |
| Official `unit/tracking` file | `0.53` package, Linux amd64, PG 18.6 | 2026-10-29 | 54/58 pass; 4 fail (2 Lua/Functions, 1 `maxmemory` eviction, 1 count after failed `EVAL`) |
| Mixed-dataset PostgreSQL recovery (6 RESP/SQL profiles, 48 phases) | `e8cb31f5`, Linux amd64, Debian 13, PG 18.6 | 2026-10-30 | 246,784 assertions pass across normal restart, immediate shutdown WAL recovery and logical restore |
| TTL and restart recovery regression (26 deadline fixtures × RESP2/RESP3) | `0.53` package, Linux amd64, Debian 13, PG 18.6 | 2026-10-30 | 1,729/1,729 checks pass across 12 database restarts and 3 PG epochs |
| Transactional outbox (`examples/outbox.sql`, native/ACL × RESP2/RESP3) | `715827aa0`, Linux arm64, PG 18.6 | 2026-10-21 | 46/46 checks pass in each of 4 profiles |
| Application suites (Django/Go, RQ 2.12.0, Spring Session 4.1.1, Sidekiq 8.1.7, Celery 5.6.3) | `715827aa0`, Linux arm64, PG 18.6 | 2026-10-21 | Django/Go 64/64 core pass; Spring 48 core + 24 recovery pass; RQ 26/28 core pass; Sidekiq 6 pass on RESP3 (Lua poller unsupported); Celery 0/4 (fails at startup `EVALSHA`) |
{.wide}

### Delivery stages (P0–P6) {#stages}

The original P0–P6 stages remain the long-term engineering roadmap. Bounded checkpoint passes and the `v0.1.0-rc1` MVP candidate do not complete P0–P6:

| Stage | Scope |
| --- | --- |
| P0 | Reference sources, command inventory, test ledger and acceptance contract |
| P1 | Native PostgreSQL role identity and secure vertical slice |
| P2 | Core data types and transactions |
| P3 | Blocking commands, Pub/Sub and keyspace events |
| P4 | First installable version and operational verification |
| P5 | Extended data types, Redis ACL and application framework coverage |
| P6 | Management commands, object encoding, serialization, server behavior and seven-client matrix |

---

Backlinks:

- [MVP goal (v0.1.0)](/docs/redis/design/mvp-goal/)
- [Quick start](/docs/redis/quickstart/)
- [Commands](/docs/redis/reference/commands/)
- [Data types](/docs/redis/reference/data-types/)
- [Releases](/docs/redis/releases/)
- [Status](/docs/redis/status/)
- [Connect a Redis client](/docs/redis/tutorial/redis-client/)
