<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Operations on Mimus</title><link>https://mimus.pgsty.com/docs/redis/operations/</link><description>Recent content in Operations on Mimus</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 06 Dec 2026 15:37:05 +0800</lastBuildDate><atom:link href="https://mimus.pgsty.com/docs/redis/operations/index.xml" rel="self" type="application/rss+xml"/><item><title>Upgrade and recovery</title><link>https://mimus.pgsty.com/docs/redis/operations/upgrade/</link><guid>https://mimus.pgsty.com/docs/redis/operations/upgrade/</guid><description>&lt;p&gt;&lt;code&gt;pgredis&lt;/code&gt; stores its catalog schema and durable data inside PostgreSQL 18. Extension upgrades use &lt;code&gt;ALTER EXTENSION&lt;/code&gt;, background cleanup runs inside a PostgreSQL background worker, and backup and recovery use standard PostgreSQL physical or logical tools.&lt;/p&gt;&#10;&lt;h2 id="upgrade"&gt;Extension upgrades&#10;&lt;/h2&gt;&#10;&lt;p&gt;The extension ships sequential SQL migration scripts from &lt;code&gt;0.1&lt;/code&gt; through &lt;code&gt;0.54&lt;/code&gt; (&lt;code&gt;extension/pg_redis--*.sql&lt;/code&gt;). To upgrade an existing database to the current &lt;code&gt;0.54&lt;/code&gt; schema (ABI &lt;code&gt;3&lt;/code&gt;):&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;h3 id="install-the-updated-binary-and-extension-files"&gt;Install the updated binary and extension files&#10;&lt;/h3&gt;&#10;&lt;p&gt;Install the matching &lt;code&gt;pgredis&lt;/code&gt; gateway binary, &lt;code&gt;pg_redis.so&lt;/code&gt; library, &lt;code&gt;pg_redis.control&lt;/code&gt;, and &lt;code&gt;pg_redis--*.sql&lt;/code&gt; files on the PostgreSQL host. Stop the PostgreSQL instance before replacing a loaded &lt;code&gt;pg_redis.so&lt;/code&gt; file, then start PostgreSQL and the new gateway.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;h3 id="run-the-catalog-update-in-postgresql"&gt;Run the catalog update in PostgreSQL&#10;&lt;/h3&gt;&#10;&lt;p&gt;Connect to each database where &lt;code&gt;pg_redis&lt;/code&gt; is installed and update the extension as its administrator:&lt;/p&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-98d23818-fence-0" data-td-code data-td-code-auto-id&#10; data-td-language="sql" data-td-line-count="3"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-98d23818-fence-0-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;EXTENSION&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pg_redis&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;TO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;0.54&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;extversion&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pg_extension&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;extname&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;pg_redis&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_abi_version&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;Verify that &lt;code&gt;extversion&lt;/code&gt; is &lt;code&gt;0.54&lt;/code&gt; and &lt;code&gt;redis._abi_version()&lt;/code&gt; returns &lt;code&gt;3&lt;/code&gt;.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;h3 id="reconcile-prerequisite-checks-if-upgrading-from-older-schemas"&gt;Reconcile prerequisite checks if upgrading from older schemas&#10;&lt;/h3&gt;&#10;&lt;p&gt;Two migration steps refuse to overwrite ambiguous state automatically:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;code&gt;0.49 → 0.50&lt;/code&gt; (&lt;code&gt;redis._acl_service&lt;/code&gt;):&lt;/strong&gt; If a bound ACL service role was dropped or renamed in &lt;code&gt;pg_roles&lt;/code&gt; so its legacy &lt;code&gt;role_oid&lt;/code&gt; and &lt;code&gt;role_name&lt;/code&gt; disagree, the migration raises SQLSTATE &lt;code&gt;55000&lt;/code&gt; (&lt;code&gt;ACL service bindings require explicit reconciliation before update to 0.50&lt;/code&gt;). Reconcile or unbind the stale entry before retrying.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;code&gt;0.50 → 0.51&lt;/code&gt; (&lt;code&gt;stream_group_ready&lt;/code&gt; trigger):&lt;/strong&gt; The migration verifies the SHA-256 hash of &lt;code&gt;redis._stream_group_ready()&lt;/code&gt; before adding a &lt;code&gt;WHEN (OLD.kind='x')&lt;/code&gt; filter, raising &lt;code&gt;55000&lt;/code&gt; if the trigger or function was manually customized.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;</description></item><item><title>Authentication and permissions</title><link>https://mimus.pgsty.com/docs/redis/operations/security/</link><guid>https://mimus.pgsty.com/docs/redis/operations/security/</guid><description>&lt;p&gt;&lt;code&gt;pgredis&lt;/code&gt; enforces permissions inside the &lt;code&gt;pg_redis&lt;/code&gt; C dispatcher on every command. Even if a client bypasses the Go gateway and calls &lt;code&gt;redis.command(...)&lt;/code&gt; directly over SQL, the C extension verifies the active PostgreSQL role capabilities or Redis ACL session before touching &lt;code&gt;redis._keyspace&lt;/code&gt; or any typed value table.&lt;/p&gt;&#10;&lt;h2 id="modes"&gt;Authentication modes&#10;&lt;/h2&gt;&#10;&lt;p&gt;The gateway &lt;code&gt;-auth-mode&lt;/code&gt; flag selects how Redis clients authenticate:&lt;/p&gt;&#10;&lt;div class="td-table-scroll td-table-scroll--static"&gt;&#10;&lt;table class="wide expand td-table--wide"&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th scope="col"&gt;Mode&lt;/th&gt;&#10; &lt;th scope="col"&gt;Flag&lt;/th&gt;&#10; &lt;th scope="col"&gt;Client &lt;code&gt;AUTH&lt;/code&gt; syntax&lt;/th&gt;&#10; &lt;th scope="col"&gt;Identity enforced by &lt;code&gt;pg_redis&lt;/code&gt;&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;PostgreSQL role mode&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;-auth-mode native&lt;/code&gt; (default)&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;AUTH &amp;lt;pg_role&amp;gt; &amp;lt;password&amp;gt;&lt;/code&gt; or &lt;code&gt;AUTH &amp;lt;password&amp;gt;&lt;/code&gt; (uses &lt;code&gt;-default-user&lt;/code&gt;)&lt;/td&gt;&#10; &lt;td&gt;PostgreSQL login role and SQL &lt;code&gt;EXECUTE&lt;/code&gt; grants on capability functions&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Redis ACL mode&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;-auth-mode redis-acl&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;AUTH &amp;lt;acl_user&amp;gt; &amp;lt;password&amp;gt;&lt;/code&gt; or &lt;code&gt;AUTH &amp;lt;password&amp;gt;&lt;/code&gt; (for &lt;code&gt;default&lt;/code&gt;)&lt;/td&gt;&#10; &lt;td&gt;Redis ACL user row in &lt;code&gt;redis._acl_user&lt;/code&gt; accessed via a bound PostgreSQL service role&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;Before authentication succeeds on a connection that requires &lt;code&gt;AUTH&lt;/code&gt;, the gateway restricts incoming command headers to at most 10 arguments and 16,384 bytes per bulk argument so unauthenticated callers cannot allocate large buffers.&lt;/p&gt;</description></item><item><title>Build from source</title><link>https://mimus.pgsty.com/docs/redis/operations/build/</link><guid>https://mimus.pgsty.com/docs/redis/operations/build/</guid><description>&lt;p&gt;Building &lt;code&gt;pgredis&lt;/code&gt; from source compiles both the &lt;code&gt;pg_redis&lt;/code&gt; PostgreSQL C extension and the &lt;code&gt;pgredis&lt;/code&gt; Go gateway executable.&lt;/p&gt;&#10;&lt;h2 id="toolchain"&gt;Toolchain&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;PostgreSQL 18&lt;/code&gt;&#10;Server binaries (&lt;code&gt;initdb&lt;/code&gt;, &lt;code&gt;pg_ctl&lt;/code&gt;, &lt;code&gt;postgres&lt;/code&gt;, &lt;code&gt;psql&lt;/code&gt;), &lt;code&gt;pg_config&lt;/code&gt;, and server development headers (&lt;code&gt;postgresql-server-dev-18&lt;/code&gt; on Debian/Ubuntu).&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;Go 1.27.4&lt;/code&gt;&#10;Required to build the gateway and test harnesses. &lt;code&gt;CGO_ENABLED=1&lt;/code&gt; is mandatory because the gateway uses libc host resolution for &lt;code&gt;MIGRATE&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;C11 compiler&lt;/code&gt;&#10;&lt;code&gt;clang&lt;/code&gt; or &lt;code&gt;gcc&lt;/code&gt; compatible with the PostgreSQL PGXS build flags reported by &lt;code&gt;pg_config&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;Python 3&lt;/code&gt;&#10;Used by &lt;code&gt;scripts/prepare_pgx.py&lt;/code&gt; (which applies the local read-budget patch to the vendored &lt;code&gt;pgx&lt;/code&gt; cache) and by the reference/application test runners.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The gateway and both Go test modules require Go 1.27.4. Current source uses &lt;code&gt;pgx&lt;/code&gt; v5.12.0 with the project&amp;rsquo;s read-budget and password-preparation patch; the &lt;code&gt;v0.1.0-rc1&lt;/code&gt; packages use v5.11.0. The Go client tests use &lt;code&gt;go-redis&lt;/code&gt; v9.23.0.&lt;/p&gt;</description></item><item><title>Install</title><link>https://mimus.pgsty.com/docs/redis/operations/install/</link><guid>https://mimus.pgsty.com/docs/redis/operations/install/</guid><description>&lt;p&gt;&lt;code&gt;pgredis&lt;/code&gt; is currently at release candidate &lt;code&gt;v0.1.0-rc1&lt;/code&gt; (product version &lt;code&gt;0.1.0&lt;/code&gt;, extension schema &lt;code&gt;0.54&lt;/code&gt;, ABI &lt;code&gt;3&lt;/code&gt;, commit &lt;code&gt;11411411d72ab45456904cc602cefbb13b68ff25&lt;/code&gt;, 2026-11-08). No public download URL or apt/rpm repository is published yet. Install either from a local Linux development archive built for PostgreSQL 18.6 or by &lt;a href="https://mimus.pgsty.com/docs/redis/operations/build/"&gt;building from source&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="packages"&gt;Candidate packages&#10;&lt;/h2&gt;&#10;&lt;p&gt;The &lt;code&gt;v0.1.0-rc1&lt;/code&gt; development archives target Debian 13 (trixie) and PostgreSQL 18.6 from PGDG:&lt;/p&gt;&#10;&lt;div class="td-table-scroll td-table-scroll--static"&gt;&#10;&lt;table class="wide expand td-table--wide"&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th scope="col"&gt;Archive&lt;/th&gt;&#10; &lt;th scope="col"&gt;Platform&lt;/th&gt;&#10; &lt;th scope="col"&gt;Size (bytes)&lt;/th&gt;&#10; &lt;th scope="col"&gt;SHA-256&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;code&gt;pgredis-0.1.0-pg18.6-debian13-amd64.tar.gz&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Linux &lt;code&gt;x86_64&lt;/code&gt;, glibc 2.41&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;9,321,730&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;d72fdcb4f40d429e5b650d0671105c923db7ceb4425b50f68d45eea0d61e2ba8&lt;/code&gt;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;code&gt;pgredis-0.1.0-pg18.6-debian13-arm64.tar.gz&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Linux &lt;code&gt;aarch64&lt;/code&gt;, glibc 2.41&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;8,574,419&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;4dcc546ef4c0562eb0b69500c0bbb43f664c3b955259ccde92900ef52e269cd7&lt;/code&gt;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;Each archive contains these members at its top level:&lt;/p&gt;</description></item></channel></rss>