Chris van Eijk: Unique per tenant in PostgreSQL: soft delete and RLS leaks
Unique constraints in multi-tenant PostgreSQL 17, tested: per tenant or global, soft delete, case, NULLs, ON CONFLICT, and what a duplicate-key error reveals.
Community stream
Unique constraints in multi-tenant PostgreSQL 17, tested: per tenant or global, soft delete, case, NULLs, ON CONFLICT, and what a duplicate-key error reveals.
A trigger-based audit log in PostgreSQL 17, measured: row against statement triggers, full rows against changed columns, and row-level security on the log.
Deleting one tenant from a shared PostgreSQL 17 database, measured: cascade, batches or dropping a partition; locks, batch size, disk space, what stays behind.
count(*) per tenant in PostgreSQL 17, measured: why it got 5× slower for the largest tenant, when estimates are wrong, and what a counter row costs under load.
Thirteen years later! Thirteen years ago today, I created this blog on WordPress.com because I wanted to share some best practices I discovered while developing various web and enterprise applications with both Java and .NET. Prior to LLMs and AI…
What an RLS policy costs in PostgreSQL 17: function volatility, the (select …) wrapper, membership subqueries and the leakproof rule that disables your index.
RLS behind PgBouncer in transaction mode, measured: which tenant context leaks, what SET LOCAL does outside a transaction, and one plan shared by tenants.
Query hints: You asked for it, Postgres 19 gave it to you. Now, they are just waiting to see how you use it. For years the Postgres community was against adding support for hints. They felt if you had correctly analyzed tables, the Postgres query…
Out now on GitHub and PGXN, pg_clickhouse v0.11.0 and the chdb extension v0.1.2 continue our dogged focus on cross-database compatibility. A slew of these enhancements derive from our header-only C libraries, clickhouse-c and pg-clickhouse-c. Let's…
`max_wal_size` is a checkpoint trigger, not a maximum—and the real cost is paid by setting it too low, not too high.
This is my personal experiment, not an official Apache Cloudberry release. Since 2017 I have been keeping an eye on the PostgreSQL ecosystem for analytics and data warehousing. At work I had used AWS Redshift, with all the drawbacks and…
Hacker News discussion (12 points, 0 comments)
After trying not to add any Rust packages to the PostgreSQL RPM repository, I finally bit the bullet and pushed pgrx and postgresql_anonymizer to the RPM repos, along with packaging guidelines: https://github.com/pgdg-packaging/pgdg-rpms/wiki/Packagi…
Errata: the max_connections post told you to size that parameter for “the replication connections.” On 12 and later, don’t. WAL senders have their own seats, sized by this parameter, and have not drawn from max_connections since PostgreSQL 12. The…
PostgreSQL 18 ships uuidv7() in core. No extension, no application code. So the old question comes back: if you want UUID keys, does the version matter? I loaded 5 million rows three ways and measured. Short answer: UUIDv7 inserted in 27 seconds,…
The SQL standard is written by a committee I sit on, so what people think it ought to contain is a professional interest of mine. The various social media algorithms seem to know this, and they serve me mostly relevant content. This one came via…
Use PostgreSQL ALTER FUNCTION SET work_mem to stop one function's sorts spilling to disk without a global change. A production fix: 150 GB a day to 0.
644 items available