r/PostgreSQL • • Oct 16 '26

Community Postgres Conference 2027 CFP is open (San Jose, April 21-23)

Post image
31 Upvotes

Mod hat off for a moment:

I'm one of the organizers of Postgres Conference, and the Call for Proposals for 2027 is now open.

Next year is the conference's 20th, so we want the program to reflect what the community has actually learned running Postgres in the real world.

When/where: April 21-23, 2027, San Jose Marriott, San Jose, CA

This year’s program brings back our core technical tracks: Essentials, Dev, Ops, and Extensions, now joined by a new AI track.

We’re also continuing Professional Development & Wellness and Life & Fun. These newer tracks have been so well received that they’ve become an essential part of the conference experience.

We're especially interested in talks from people running Postgres in production, such as:

- Lessons from production incidents: what broke, how you found it, and what you changed afterward
- Autovacuum and bloat tuning on large or high-churn tables
- HA and replication setups, including failovers that didn't go to plan
- Building extensions, or running them at scale
- Benchmarks with methodology you're willing to share and defend

You don't need to be a known speaker. A clear story about a real problem is exactly what we're looking for, and first-time speakers are welcome.

CFP and details: https://postgresconf.org/conferences/2027

Happy to answer any questions about submitting here. 

What's a Postgres problem you wish someone would give a talk about?


r/PostgreSQL • • 1d ago

Projects multi-tenant dashboards with Postgres RLS started taking 14s on our read replica. comparing materialized views, ClickHouse sync + headless semantic layer of Cube

Post image
14 Upvotes

client reporting pages on our B2B app ran cleanly for a year until the main Postgres events table crossed 42M rows. every Monday at 9am UTC, dashboard loading got too slow across Metabase and Superset, PgBouncer queued up connections, and our read replica sat pegged on 14-second sequential scans.

then the bottleneck (at least the one that i ve experienced) turned out to be how Postgres Row-Level Security interacts with BI tools. whenever we evaluated `current_setting('app.tenant_id')` inside multi-join views with optional date pickers, the planner stopped pruning partitions cleanly. on top of that, team admins needed us to restrict dashboard data by user role so regional viewers saw anonymized margin fields while billing leads kept full unit economics. per-user role policies broke shared BI card caches, forcing fresh warehouse queries per login.

i benchmarked those 3 ways out before ripping up our Postgres schema.

  1. Postgres materialized views with pg_cron: almost no new ops surface and fast index scans on fixed monthly summaries. fell apart once enterprise accounts toggled arbitrary 7-day, 30-day, and 90-day cohort windows alongside role-based column masking, because pre-generating every filter permutation in raw SQL turned into 40 maintenance scripts.
  2. CDC pipeline into ClickHouse via PeerDB: chewed through 42M-row GROUP BYs in under 150ms without touching Postgres. we stalled on two catches: consumer lag confusion after billing refunds, and having to duplicate tenant + column masking rules in both our app API and Superset SQL.
  3. headless semantic layer using Cube Core (Apache-2.0) in Docker: we put an open source BI modeling layer in front of the Postgres replica, passing signed JWT `securityContext` into YAML `access_policy` rules. row filters compile into SQL before Postgres sees them, while `member_masking` swaps restricted margin columns to NULL instead of erroring out charts. so rollups in Cube dev absorbed repeated tenant date-grain hits before Postgres ran a single scan, dropping p95 dashboard waits from 14s to under 60ms.

trade-off is simple enough: adding Cube Store rollups means watching dimension cardinality closely (putting `user_email` inside a rollup blew up build times on day one until we stripped it out). if you only serve under 30 tenants on fixed monthly KPIs, stick with native Postgres partitions and `REFRESH MATERIALIZED VIEW CONCURRENTLY`.

now would like to ask you who are running multi-tenant Postgres analytics at scale, did you stay inside pg_cron rollups, CDC out to ClickHouse/DuckDB, or put a caching layer in front?


r/PostgreSQL • • 1d ago

How-To The Watchmaker: Building a Mechanical Watch in a Database & "A Few Notes More"

Post image
6 Upvotes

HI, hopefully this is ok to post, but I am sharing with good intentions, please say if not allowed.

Long story short, I have been making SQL do what SQL should not do for many years - that's the theme of my blog, but specifically, I thought you might enjoy a couple of articles where the Spatial features in the database I was using simply did not have what I needed, and I switched to PostgreSQL both times.

I won't post both links here, as you can find them in the URL below. The second article does have the music box and is the reason I started this project in the first place.

https://sqlartist.github.io/posts/the-watchmaker-building-a-mechanical-watch-in-a-database/

All the code is on Github.

Enjoy.


r/PostgreSQL • • 1d ago

Tools A free browser playground for running real database queries, no setup

Thumbnail reddit.com
0 Upvotes

r/PostgreSQL • • 2d ago

Community PostgreSQL 19 Released!

Thumbnail postgresql.org
369 Upvotes

r/PostgreSQL • • 1d ago

Projects You can now do filtered vector search in Postgres

Thumbnail paradedb.com
1 Upvotes

r/PostgreSQL • • 2d ago

Commercial Postgres 19 is available on Neon and Lakebase as of release day

9 Upvotes

PG19 went GA yesterday and is already available on both Neon and Lakebase. On Neon it's on the free plan too. To try it, create a new project and pick version 19. Most extensions supported on 18 already work on 19, but not all of them yet, so check the extension list before planning a migration. Quick overview of what's new in 19:

REPACK, which can rebuild a table with CONCURRENTLY while reads and writes continue. It still takes a brief ACCESS EXCLUSIVE lock at the end.

pg_plan_advice and pg_stash_advice, for steering the planner and applying stored advice by query ID. Robert Haas, a committer on the Neon team, wrote these.

autovacuum_max_parallel_workers for parallel index vacuuming, plus a new scoring system that decides which tables get vacuumed or analyzed first.

New views: pg_stat_lock, pg_stat_recovery and pg_stat_autovacuum_scores.

WAIT FOR LSN, for read-your-writes on replicas without polling.

Logical replication: sequence sync, FOR ALL TABLES EXCEPT, and you can enable logical decoding without a restart when wal_level is replica.

INSERT ... ON CONFLICT DO SELECT, and COPY TO can now output JSON (export only).

Changed defaults to watch for: JIT is off, TOAST compression defaults to lz4, max_locks_per_transaction is now 128, md5 auth gives stronger deprecation warnings, RADIUS auth is removed, and standard_conforming_strings is always on.


r/PostgreSQL • • 2d ago

Projects PostgreSQL gets radar and pg_statviz for fast diagnosis

Thumbnail imasters.com
8 Upvotes

r/PostgreSQL • • 3d ago

Tools Tiger Data announced pg_vectorsearch: Scalable Open-Source Vector Search in PostgreSQL

Thumbnail tigerdata.com
48 Upvotes

Tiger Data has released pg_vectorsearch, an open source PostgreSQL extension for vector similarity search, currently in alpha. Its PRISM index uses data partitioning and compression instead of the graph-based approach used by pgvector’s HNSW index, reducing memory requirements and index build times.

According to the authors, pg_vectorsearch enables faster, more memory-efficient vector search directly in PostgreSQL, reducing the infrastructure required to handle large vector datasets. The extension supports existing pgvector columns, allowing applications to perform vector search without a separate database. To use the new capabilities, developers must install the extension and create a PRISM index on the vector column:

CREATE EXTENSION pg_vectorsearch;
CREATE INDEX ON documents USING prism (embedding vec32_l2_ops);

In Tiger Data’s own benchmarks using 100 million vectors, PRISM built an index in 1 hour and 40 minutes on a machine with 128 GB of memory, while HNSW (Hierarchical Navigable Small World) took 42 hours on a machine with 512 GB of memory. Formerly known as Timescale, Tiger Data is the company behind TimescaleDB, the open source PostgreSQL extension for time-series data and real-time analytics.


r/PostgreSQL • • 2d ago

Tools pg_clickhouse 0.11.1: Now with pgvector, UPDATE, DELETE pushdown

Thumbnail clickhouse.com
9 Upvotes

Don't let the minor version increment fool you: pg_clickhouse v0.11.1, released last week, delivers a slew of improvements and bug fixes, including UPDATE, DELETE, TRUNCATE, and pgvector search pushdown.


r/PostgreSQL • • 2d ago

Community Which databases/caches do you use alongside PostgreSQL?

Thumbnail reddit.com
5 Upvotes

No idea which postgres group I'm supposed to post to, so posting to both


r/PostgreSQL • • 2d ago

Commercial 12 New themes now in Beekeeper Studio

Post image
1 Upvotes

Hope this makes PostgreSQL work more enjoyable!


r/PostgreSQL • • 2d ago

Tools I tried to break Prisma Postgres with a live app

Thumbnail reddit.com
0 Upvotes

r/PostgreSQL • • 3d ago

Help Me! What is 19rc2-1?

5 Upvotes

My podman just auto updated from 19rc2 to rc2-1. Can't find a changelog.

also 19 is supposed to be released tomorrow. there is a 19.0 tag on GitHub that seems new. any idea? I may just try and pull :19 tonight and see what I get since last week :19 didn't pull anything.

edit- no :19 tag yet.

https://github.com/docker-library/official-images/blob/master/library/postgres

I'm guessing rc2-1 was a quick cve fix


r/PostgreSQL • • 4d ago

How-To More load is faster: tuning Postgres read replicas

Thumbnail clickhouse.com
20 Upvotes

Replica lag is lower than conventional wisdom suggests out of the box if you have traffic, and pretty easy to get to a few seconds with basic tuning.

You can get some spectacularly short replica lag if you’re willing to be unreasonable or incur tradeoffs.


r/PostgreSQL • • 5d ago

Projects PostgreSQL 18 on a 256-512 MiB VPS: How much memory does it really need?

16 Upvotes

Last week I shared my experiment running PostgreSQL 18 on a 256-512 MiB VPS, including the low-memory configuration that worked best.

I had always assumed MariaDB would use less RAM for small workloads because of its single-process architecture, compared to PostgreSQL's multi-process model.

So I decided to test MariaDB 10.11.14 under similar memory constraints and compare the findings with PostgreSQL 18.6.

Peak process memory (PSS) at 512 MiB:

ConfigurationPeak PSS
PostgreSQL default180.1 MiB
PostgreSQL tuned50.4 MiB
MariaDB default215.9 MiB
MariaDB tuned (64 MB pool)125.6 MiB
MariaDB tuned (32 MB pool)93.6 MiB

At 256 MiB, both tuned PostgreSQL configurations completed their tests. For MariaDB, only the most conservative configuration (32 MB InnoDB buffer pool) completed. The default and 64 MB configurations were OOM-killed.

What I found interesting:

  • PostgreSQL's multi-process architecture didn't necessarily mean higher memory consumption.
  • Both databases benefited substantially from conservative memory settings.
  • MariaDB's smaller 32 MB buffer pool reduced memory usage but also reduced throughput compared with its 64 MB configuration at 512 MiB.

An important caveat: these were separate, short, read-only experiments with different datasets and SQL workloads. The PSS numbers are useful for understanding each database's memory behavior, but they aren't directly comparable as a head-to-head benchmark.

My takeaway is that database configuration matters much more than I initially expected, and PostgreSQL can be a practical choice even on a very small VPS.

Full comparison, configurations, and methodology:

https://pvrlabs.xyz/java-performance/experiments/mariadb-postgresql-small-vps.html

Has anyone else compared PostgreSQL and MariaDB specifically for low-memory deployments? I'd be interested in your experience.


r/PostgreSQL • • 4d ago

Tools I built PGZen, a native PostgreSQL client for macOS — launched today on Product Hunt

Thumbnail reddit.com
0 Upvotes

r/PostgreSQL • • 5d ago

How-To Dr. Ibrar Ahmed on When Postgres Breaks: A Practical Guide to Corruption and Disaster Recovery - Free Online Webinar 11/19 8AM PST

Thumbnail pgedge.com
9 Upvotes

r/PostgreSQL • • 5d ago

Help Me! Composite PK vs surrogate id for memberships/roles in a multitenant Postgres schema

3 Upvotes

So I am designing a multitenant platform database in PostgreSQL. A user belongs to an org through a membership and can hold several roles in it.

When drafting the `memberships` and `membership_roles` tables, I found myself with two ways of handling the primary and foreign keys:

Design A (Composite Keys):

CREATE TABLE memberships (

org_id uuid REFERENCES organizations(id),

user_id uuid REFERENCES users(id),

created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,

status membership_status DEFAULT 'active',

PRIMARY KEY (org_id, user_id)

);

CREATE TABLE membership_roles (

org_id uuid,

user_id uuid,

role_id INT REFERENCES roles(id),

FOREIGN KEY (org_id, user_id) REFERENCES memberships(org_id, user_id),

PRIMARY KEY (org_id, user_id, role_id)

);

Design B (Surrogate Key):

``` CREATE TABLE memberships (

id SERIAL PRIMARY KEY,

org_id uuid REFERENCES organizations(id),

user_id uuid REFERENCES users(id),

created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,

status membership_status DEFAULT 'active',

UNIQUE (org_id, user_id)

);

CREATE TABLE membership_roles (

membership_id INT REFERENCES memberships(id),

role_id INT REFERENCES roles(id),

PRIMARY KEY (membership_id, role_id)

);

```

From what I can tell so far, both enforce the exact same constraints. Design A makes it easier to filter or partition by org since `org_id` lives directly on the child rows, whereas Design B gives a clean single-column handle for other tables and APIs at the cost of requiring a join to get `org_id`.

Generally, when there are multiple ways to model something like this, there is often a subtle catch down the road. Between these two, is there any significant difference or impact I might be missing, especially around performance at scale, general maintenance or anything really? Which one would you pick, and why?


r/PostgreSQL • • 7d ago

Community How did Postgres displace MySQL?

433 Upvotes

For many years MySQL was the default go to open source database, and Postgres was always the “other one,” but at some point in the past 3 years, it flipped.

Now Postgres is considered the default go to for pretty much everything.

Was it when Oracle bought MySQL that everyone bailed?

Always been a huge fan of BSD and Postgres, the engineering on both has always been just really really well done.


r/PostgreSQL • • 6d ago

Community I got tired of "SELECT 1" microbenchmarks, so I tested 25 ORMs across 9 languages against a real 78M-row Postgres database. Here is what broke.

0 Upvotes

👉 GitHub Repo & Full Report: https://github.com/tusharad/orm-benchmark


Every ORM benchmark I see online tests the same trivial query: SELECT * FROM users WHERE id = 1;

This doesn't benchmark an ORM. It benchmarks Linux loopback TCP socket round-trip time.

In production, ORMs don't fall over on primary-key lookups. They buckle when:

  1. Deserializing 10,000 wide rows into typed structs under memory pressure.
  2. Materializing 4-level deep entity graphs without Cartesian explosions or N+1 floods.
  3. Compiling recursive CTEs, multi-frame window functions (ROWS BETWEEN 4 PRECEDING), or pgvector cosine similarity.
  4. Squeezing 100 concurrent workers competing for row locks (SELECT ... FOR UPDATE) through a constrained connection pool.
  5. Emitting 300 lines of incomprehensible internal template/typeclass garbage when a database column type changes.

To see how modern ORMs actually behave under real production load, I built a standardized, reproducible benchmark suite testing 25 ORMs across 9 programming languages (Go, Rust, C#, Java, Elixir, TypeScript, Python, Ruby, Haskell) against the official Postgres Air database (2024 edition, 78,232,673 real-world flight records on PostgreSQL 17 with pgvector).

Every single ORM was held to the exact same invariants: a strict 20-connection pool, zero raw string interpolation (native typed query builders only), and typed entity deserialization into domain records.


The Executive Leaderboard

RankORMLanguageOverall ScorePassed (HQ01–16)Avg p95 LatencyPeak RPS (C=50)Hydration SpeedMax Heap RSSBlast RadiusCompiler UX
🥇 1sqlcGo 1.2389.616/1658.80 ms32,340 ops/s1,518,142 rows/s25.12 MB1 line10/10
🥈 2hasqlHaskell (GHC 9.10)89.516/1665.83 ms277 ops/s199,025 rows/s13.03 MB1 line10/10
🥉 3DapperC# / .NET 889.516/1662.67 ms264 ops/s1,279,038 rows/s87.27 MB1 line10/10
4jOOQJava 2189.416/1657.71 ms9,739 ops/s454,966 rows/s149.00 MB1 line10/10
5entGo 1.2389.316/1661.36 ms246 ops/s570,841 rows/s25.12 MB1 line10/10
6ectoElixir 1.17 / OTP 2789.216/1658.20 ms29,412 ops/s354,070 rows/s83.06 MB1 line10/10
7squealHaskell (GHC 9.10)89.116/16187.03 ms258 ops/s15,271 rows/s25.17 MB1 line10/10
8ihpHaskell (GHC 9.10)89.116/1670.41 ms361 ops/s144,224 rows/s76.00 MB1 line10/10
9hibernate-ormJava 2189.116/1662.66 ms256 ops/s564,130 rows/s15.00 MB1 line10/10
10efcoreC# / .NET 889.016/1668.51 ms260 ops/s1,391,131 rows/s139.80 MB1 line10/10
11orvilleHaskell (GHC 9.10)88.916/1673.71 ms247 ops/s99,705 rows/s38.79 MB1 line10/10
12gormGo 1.2388.916/1658.50 ms256 ops/s712,657 rows/s25.37 MB1 line10/10
13rel8Haskell (GHC 9.10)88.816/16132.32 ms254 ops/s122,678 rows/s18.75 MB1 line10/10
14persistentHaskell (GHC 9.10)88.716/1677.55 ms251 ops/s103,221 rows/s21.03 MB1 line10/10
15mikro-ormTypeScript (Node 22)88.716/1658.19 ms3,302 ops/s182,594 rows/s239.52 MB1 line10/10
16esqueletoHaskell (GHC 9.10)88.616/1682.16 ms250 ops/s85,377 rows/s25.22 MB2 lines10/10
17haskell-opaleyeHaskell (GHC 9.10)88.516/1680.38 ms254 ops/s101,544 rows/s26.54 MB2 lines10/10
18beamHaskell (GHC 9.10)88.416/1613.57 ms241 ops/s113,504 rows/s22.39 MB6 lines10/10
19dieselRust 1.8388.016/1659.10 ms266 ops/s1,373,304 rows/s33.33 MB3 lines10/10
20typeormTypeScript (Node 22)87.816/1655.99 ms235 ops/s385,422 rows/s71.55 MB1 line10/10
21railsRuby 3.3 (YJIT)87.516/1685.34 ms247 ops/s89,792 rows/s150.00 MB1 line10/10
22sqlalchemyPython 3.12 (asyncpg)87.416/1672.57 ms5,718 ops/s279,239 rows/s92.50 MB1 line10/10
23prismaTypeScript (Rust Engine)87.216/1683.54 ms264 ops/s208,122 rows/s36.71 MB1 line10/10
24drizzle-ormTypeScript (Node 22)86.816/1664.45 ms242 ops/s498,613 rows/s184.58 MB4 lines10/10
25sea-ormRust 1.83 (sqlx)86.716/1666.15 ms272 ops/s1,235,677 rows/s34.08 MB1 line10/10

The 5 Biggest Surprises

  1. The Zero-Reflection Hydration Tier (> 1.2M rows/sec): sqlc (1.52M rows/s), EF Core 8 (1.39M rows/s), diesel (1.37M rows/s), and Dapper (1.28M rows/s) operate in a different galaxy compared to reflection-heavy ORMs. Direct struct memory mapping and compiled pointer assignments destroy runtime reflection when reading wide tables.
  2. The BEAM Actor Model Destroyed Connection Contention: Under $C=100$ concurrent load on a 20-connection pool, most runtimes bottlenecked on thread pools or single event loops. Elixir’s ecto handled pool checkout through isolated BEAM process mailboxes with near-zero queue latency, sustaining 29,412 requests/second.
  3. Node.js / V8 Event Loop Saturation: TypeScript ORMs (drizzle, prisma, typeorm) performed well on single queries, but hit an unmistakable wall at $C=50..100$. Because V8 serializes and constructs thousands of JavaScript objects on a single thread, CPU time saturated the event loop, driving $p_{99}$ tail latencies beyond 500 ms and capping RPS around 225–264 ops/s.
  4. Haskell’s Memory Anomaly: Haskell’s hasql clocked the lowest resident memory footprint of the entire 25-ORM field at just 13.03 MB Peak Heap RSS, utilizing zero-copy PostgreSQL binary codecs.
  5. The Deliberate Mistake Suite (Compiler UX): We injected 10 deliberate compiler mistakes (type mismatches, dangling joins, nullability violations, scope leakage). While tools like sqlc, squeal, hasql, and ent caught errors in 6–10 lines of clean output, complex typeclass/macro builders (rel8, drizzle) sometimes spewed 60–80 lines of internal framework plumbing.

Reproduce It / Add Your Favorite ORM

The benchmark repo contains all calculations, runner scripts, Docker setup, and the 25 JSON scorecards:

👉 GitHub Repository: https://github.com/tusharad/orm-benchmark

If you want to add an ORM (e.g. Kysely, Slonik, Bun, Peewee, SQLDelight), check out templates/generic/HARNESS_CONTRACT.md and submit a PR!

I'd love to hear your thoughts, critique of the methodology, or experiences running these tools in high-throughput production.


r/PostgreSQL • • 7d ago

Projects I built a free native Windows client for PostgreSQL (and SQL Server, MySQL, SQLite)

Post image
0 Upvotes

I write SQL all day and got tired of waiting on Java and Electron apps, so I wrote RimestDB with WinUI 3 and .NET. On my machine it opens in about 2 seconds and uses 66 MB with a connection open. DBeaver on the same machine and database: 11 seconds and 338 MB (warm start, memory as shown in Task Manager).

A few things I built around Postgres habits:

  • Manual commit mode per connection. Inside a transaction every statement gets its own savepoint, so one typo doesn’t leave you with “current transaction is aborted”.
  • The row limit goes to the server as LIMIT, so previewing 50 rows of a big table doesn’t pull every row over the wire.
  • In manual mode, read-only SELECTs don’t open a transaction, so browsing data doesn’t leave a lock that holds up a migration.
  • A confirmation before UPDATE/DELETE without WHERE.
  • JSON values open formatted in a side panel. Connections import from DBeaver and pgpass.conf.

It’s free, with no account and no time limit. There’s also an optional paid Pro tier. Windows 10/11 only.

I’d like blunt feedback from people who live in a DB client: what would stop you from switching?

db.rimest.com


r/PostgreSQL • • 8d ago

Community CFP is open for POSETTE: An Event for Postgres 2027 (until Sun 3 Jan 2027)

3 Upvotes

Hi! I'm on the talk selection team for POSETTE: An Event for Postgres 2027, and the CFP is now open until Sunday 3 Jan 2027 at 11:59pm PST. Things to know, if you're thinking about submitting:

  • New this year: 20-minute talks, or 5-minute lightning talks (you pick when you submit)
  • No travel required: the POSETTE team pre-records your talk, with you presenting remotely
  • Talks get published on YouTube afterward, with captions in 17 languages
  • First-time speakers are very welcome
  • The event is free & virtual, with 2 livestreams on 30 & 31 March 2027 (one best for the Americas time zones, one best for EMEA & APAC time zones)

Everything you need to know about the POSETTE 2027 CFP—including topic ideas, selection process, and tips for a great proposal: https://posetteconf.com/2027/cfp/

POSETTE is brought to you by the Postgres team at Microsoft, in partnership with AMD.


r/PostgreSQL • • 9d ago

Projects Two tricks we used to cache tables with Row Level Security (policy inlining + pg_logical_emit_message)

Post image
12 Upvotes

My co-founder James just shipped the first of two big swings at Row Level Security in PgCache, our caching proxy for Postgres. In case it's not obvious, I'm one of the founders, but the two tricks he used are pretty neat on their own, so I wanted to share them here.

The problem with caching RLS tables is pretty simple: If your cache keys on the SQL text, you give tenant 7's orders to tenant 8, so until now we told anyone using RLS to leave those tables out of PgCache.

1- The policy is just part of the WHERE clause

Back in August, James told me "RLS itself is just an extension to the WHERE clause," and that's basically how it works now. PgCache asks Postgres which policies apply to the session's role, fills in the session's own values, and folds them into the query:

CREATE POLICY tenant_policy ON orders
  USING (tenant_id = current_setting('app.tenant_id')::int);

-- after SET app.tenant_id = '7', this query
SELECT * FROM orders WHERE status = 'open';
-- gets cached as
SELECT * FROM orders WHERE status = 'open' AND tenant_id = 7;

So every tenant gets its own cache entry (and two sessions for the same tenant share one).

The obvious alternative was a cache entry per role, but then PgCache couldn't check new rows from the replication stream against the policy, so every insert into an RLS table would mean throwing cached results away.

Once the policy is a plain filter, the replication stream keeps each tenant's results fresh in place, like any other query. The tradeoff is that the role PgCache connects with needs to see every row for when it fills the cache (but if you're using PgCache you're already using a role that has access to logical replication anyway).

2- Getting DDL into the replication stream

The big challenge is that there's not enough in the logical replication stream to actually support Row Level Security. Logical replication is all about rows, so it never tells you when someone runs CREATE POLICY or REVOKE.

Our fix is a pair of event triggers on your database that turn each DDL command into a logical message:

PERFORM pg_logical_emit_message(true, 'pgcache', <the objects that changed>);

That true makes it transactional, so the message lands in the stream (and in the right order) inside the same transaction. And there's no extension to install.

Roles were the one gap, since event triggers don't fire for ALTER ROLE or GRANT role TO role. James really didn't want to poll anything, but PgCache now reads pg_roles and pg_auth_members every 5 seconds, which turned out to be way cheaper than the alternatives.

The second of our 2 big swings will be policies built on JWT claims (Supabase's auth.uid()), which still pass through to Postgres for now. Plan is to add other rare policy shapes on an as-needed basis, but Supabase feels like tablestakes for saying "our proxy is feature complete" in 2026.

James wrote up all the details in the repo: ADR-062 for the policy inlining, ADR-058 for the event triggers and ADR-061 for privileges and the role poll. The compatibility docs list what's cached and what passes through.

Curious to know how you guys are actually passing the tenant through to Postgres in production (custom setting, SET ROLE per tenant, JWT claims)?