Security & Stability
- Sandboxed Lua 5.1 VM (
src/lua.rs): Restricted mlua to safe standard libraries (table, string, math) and stripped os, io, package, debug, dofile, loadfile, collectgarbage, module, and require. Added configurable instruction-hook execution timeout (pg_redis.lua_time_limit_ms, default 5000 ms) to prevent runaway scripts from stalling the background worker.
- Real
AUTH & HELLO ... AUTH Enforcement (pg_redis.requirepass): Added SUPERUSER_ONLY GUC pg_redis.requirepass with constant-time password verification supporting both AUTH <pass> and AUTH default <pass> as well as HELLO <proto> AUTH default <pass>, returning NOAUTH / WRONGPASS when configured.
- Connection & Memory Safeguards: Added
pg_redis.max_clients (default 1000), pg_redis.max_frame_bytes (default 64 MiB), and bounded per-subscriber Pub/Sub queues (pg_redis.pubsub_queue_size, default 4096) with automatic slow-consumer eviction.
Added
- Universal Key Expiration (
pg_redis_key_expiry): Extended EXPIRE, PEXPIRE, EXPIREAT, PEXPIREAT, TTL, PTTL, PERSIST, and background TTL eviction to work across all 6 data types (Strings, Hashes, Lists, Sorted Sets, Sets, and Streams), added Redis 7 NX / XX / GT / LT flags, and added EXPIRETIME / PEXPIRETIME.
- Collection Scans & Session Helpers: Added
HSCAN (including MATCH, COUNT, NOVALUES), SSCAN, ZSCAN, fixed SCAN ... TYPE <type> filtering, and added GETEX (EX, PX, EXAT, PXAT, PERSIST) for rolling session TTLs (connect-redis) and BullMQ FlowProducer / dependency pagination.
- Multi-Client Registry (
src/clients.rs): Upgraded CLIENT LIST (with TYPE / ID filters), CLIENT INFO, CLIENT KILL (ID / ADDR), and INFO # Clients (connected_clients, maxclients) across all active TCP connections so BullMQ queue.getWorkers() and queue.getQueueEvents() report live workers.
- Pattern Pub/Sub (
src/pubsub.rs): Added PSUBSCRIBE, PUNSUBSCRIBE, pmessage push delivery, and live PUBSUB NUMPAT counts over the in-process PubSubHub.
- Upgrade Script: Added
sql/pg_redis_core--0.3.0--0.4.0.sql creating pg_redis_key_expiry.
Prebuilt Extension Binaries (SHA-256)
14620397ced8b1a3e7a6dd3d4289378eb8ff1497bfcdcd2f30a2d09670b3d3fa pg_redis_core-0.4.0-pg15-linux-amd64.tar.gz
42d2dd039181be5a295f58e381bc1fab57a8fa02b4ab3e88596b80d423f8d270 pg_redis_core-0.4.0-pg16-linux-arm64.tar.gz
854cde95b2784abf9913119b9eed9338411c28eea96091adf72ac049575ca3da pg_redis_core-0.4.0-pg15-linux-arm64.tar.gz
abf3189cb2049aec38309c8016e7d4ce14a7244f8ab814fa0b030b57c08cb78e pg_redis_core-0.4.0-pg16-linux-amd64.tar.gz
Docker Images (Multi-Arch: linux/amd64, linux/arm64)
# PostgreSQL 15
docker pull ghcr.io/megacoderkim/pg2redis:v0.4.0-pg15
# PostgreSQL 16
docker pull ghcr.io/megacoderkim/pg2redis:v0.4.0-pg16
Documentation
https://megacoderkim.github.io/pg2redis/