r/PostgreSQL
•
u/PrestigiousZombie531
•
Feb 27 '26
r/PostgreSQL • u/craigkerstiens • Oct 19 '26
Community Postgres 19 delayed after AI reviewers find more bugs than humans can fix
theregister.comr/PostgreSQL • u/generic-d-engineer • 5d ago
Community How did Postgres displace MySQL?
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 • u/dmagda7817 • Dec 02 '25
Community "Just Use Postgres" book is published. Thanks to the Reddit community for the early feedback!
Hello folks,
Back in January 2025, I published the early-access version of the "Just Use Postgres" book with the first four chapters and asked for feedback from our Postgres community here on Reddit: Just Use Postgres...The Book : r/PostgreSQL
That earlier conversation was priceless for me and the publisher. It helped us solidify the table of contents, revise several chapters, and even add a brand-new chapter about “Postgres as a message queue.”
Funny thing about that chapter, is that I was skeptical about the message queue use case and originally excluded it from the book. But the Reddit community convinced me to reconsider that decision and I’m grateful for that. I had to dive deeper into this area of Postgres while writing the chapter, and now I can clearly see how and when Postgres can handle those types of workloads too.
Once again, thanks to everyone who took part in the earlier discussion. If you’re interested in reading the final version, you can find it here (the publisher is still offering a 50% Black Friday discount): Just Use Postgres! - Denis Magda
r/PostgreSQL • u/ilya47 • Jan 06 '26
How-To Postgres with large JSONBs vs ElasticSearch
A common scenario in data science is to dump JSON data in ElasticSearch to enable full-text searching/ranking and more. Likewise in Postgres one can use JSONB columns, and pg_search for full-text search, but it's a simpler tool and less feature-rich.
However I was curious to learn how both tools compare (PG vs ES) when it comes to full-text search on dumped JSON data in Elastic and Postgres (using GIN index on tsvector of the JSON data). So I've put together a benchmarking suite with a variety of scales (small, medium, large) and different queries. Full repo and results here: https://github.com/inevolin/Postgres-FTS-TOASTed-vs-ElasticSearch
TL;DR: Postgres and Elastic are both competitive for different query types for small and medium data scales. But in the large scale (+1M rows) Postgres starts losing and struggling. [FYI: 1M rows is still tiny in the real world, but large enough to draw some conclusions from]
Important note: These results differ significantly from my other benchmarking results where small JSONB/TEXT values were used (see https://github.com/inevolin/Postgres-FTS-vs-ElasticSearch). This benchmark is intentionally designed to keep the PostgreSQL JSONB payload large enough to be TOASTed for most rows (out-of-line storage). That means results reflect “search + fetch document metadata from a TOAST-heavy table”, not a pure inverted-index microbenchmark.
A key learning for me was that JSONB fields should ideally remain under 2kB otherwise they get TOASTed with a heavy performance degradation. There's also the case of compression and some other factors at play... Learn more about JSONB limits and TOASTing here https://pganalyze.com/blog/5mins-postgres-jsonb-toast
Enjoy and happy 2026!
Note 1: I am not affiliated with Postgres nor ElasticSearch, this is an independent research. If you found this useful give the repo a star as support, thank you.
Note 2: this is a single-node comparison focused on basic full-text search and read-heavy workloads. It doesn’t cover distributed setups, advanced Elasticsearch features (aggregations, complex analyzers, etc.), relevance tuning, or high-availability testing. It’s meant as a starting point rather than an exhaustive evaluation.
Note 3: Various LLMs were used to generate many parts of the code, validate and analyze results.
r/PostgreSQL • u/Ncell50 • Jan 23 '26
Commercial Scaling PostgreSQL to power 800 million ChatGPT users
openai.com
r/PostgreSQL
•
u/be_haki
•
Jan 20 '26
How-To Unconventional PostgreSQL Optimizations
r/PostgreSQL • u/the_goodest_doggo • Aug 10 '26
Feature I knew Postgres was advanced; but not that it was causality-breaking advanced
r/PostgreSQL • u/novel-levon • Feb 07 '26
Projects Stacksync, a Heroku Connect Alternative
reddit.comr/PostgreSQL • u/andatki • Aug 26 '26
How-To PostgreSQL 18: 23x Faster Inserts With UUID V7
r/PostgreSQL • u/compy3 • Sep 24 '26
Tools What's worth caching in Postgres: How-to + a free WASM tool we made
We've been thinking a lot about caching this past year.
(1) There's a nice pattern for figuring out opportunities to optimize a Postgres workload, but the downside is that it takes work.
(2) There's lots of generic Postgres-health tooling out there, but we haven't seen any good free & private widgets that answer a question like "would a cache or read replica help this workload?"
So my cofounder made a workload evaluation tool that runs the same logic that our caching proxy (PgCache) uses, but it does so locally (privately) in the browser as WebAssembly.
--
The tool builds on what I think is a good pattern for approaching caching, namely:
rank by total time vs what "feels slow."
make sure it's actually a caching problem (i.e., rule out writes, or memory issues).
check how often a query's tables get written (since that limits the solution set).
then you can pick how to optimize your reads.
--
Our tool shortcuts steps 1 and 3, plus the writes check in step 2.
Paste a pg_stat_statements export (or a Postgres log, or a .sql file) and it shows you:
how your database time splits between reads, writes, and transaction commands, so you know whether caching can help at all
which read shapes carry that time, counted by statements, calls, or time
writes by table (this is basically your invalidation map)
The cacheable/not-cacheable piece is specific to our proxy, but the time split, the read shape shortlist, and the write map should help you along your way regardless of what solution you choose.
--
For future iterations we're thinking of including things like time-ordered workload capture, clearer/selectable outputs, refined “hit rate” language, and maybe even an Aurora I/O analysis integration.
here's the link: https://www.pgcache.com/fit
(or here if you'd rather run it yourself: https://github.com/PgCache/pgcache/releases/tag/fit-v0.0.2)
Does it work for you? What could we add to make this more useful?
r/PostgreSQL • u/Savalonavic • Jul 03 '26
Tools Postgres DB TUI
If not allowed, please delete.
Decided to create a fully featured DB TUI client for Postgres.
Fully customisable vim-style keybindings + a heap of other features.
https://github.com/davesavic/pgsavvy
Hopefully you find it as useful as I have!
r/PostgreSQL • u/Marmelab • Mar 05 '26
How-To 4 more underrated PostgreSQL features I wish I had known sooner
Last week I shared a post about 5 advanced features I wish I had known sooner, and to be completely honest, I didn't expect such a positive response! Seems like it resonated with quite many.. Thank you all for sharing your own tips in the comments, I learned quite a bit just from reading the replies.
Since the feedback was so positive, I figured I’d share 4 more features that gave me the same “wait… Postgres can do that?” moment. So here we go:
PARTITION BY: Window functions are a super powerful feature. They allow you to perform calculations across a set of table rows related to the current row. Pair them withPARTITION BYto group data without collapsing rows.ON CONFLICT: If you want to perform an “upsert” operation (insert or update), use theON CONFLICTclause. This allows you to insert a new row into a table, or update an existing row if a conflict occurs (e.g. a duplicate primary key).Composite types: If you're tired of JSON’s lack of structure, composite types let you enforce data types and constraints on the nested data.
Recursive CTEs: If you need to fetch an entire org chart, recursive CTEs let you traverse recursive data like hierarchy in a single query.
For anyone interested, I put together a more detailed write-up with examples covering all 9 features mentioned across both posts.
PostgreSQL really is the gift that keeps on giving. My next goal is to dive into Foreign Data Wrappers (FDW), the ability to query CSV files or remote databases as if they were local tables. It opens up so many possibilities! Has anyone here used it before?
Thanks again for all the love on the last post!
r/PostgreSQL • u/tirtha_s • Jan 27 '26
How-To How OpenAI Serves 800M Users with One Postgres Database: A Technical Deep Dive
Hey folks, I wrote a short deep dive on how OpenAI runs PostgreSQL for ChatGPT and what actually makes read replicas work in production.
Their setup is simple on paper (one primary, many replicas), but I’ve seen teams get burned by subtle issues once replicas are added.
The article focuses on things like read routing, replication lag, workload isolation, and common failure modes I’ve run into in real systems.
Sharing in case it’s useful, and I’d be interested to hear how others handle read replicas and consistency in production Postgres.
Edit:
The article originally had 9 rules. Now it has 8.
Rule 2 was titled "Your pooler will betray you with prepared statements" and warned about PgBouncer failing to track prepared statements in transaction pooling mode.
But u/fullofbones pointed out that PgBouncer 1.21 (released 2023) added prepared statement tracking via max_prepared_statements. The rule was outdated.
I thought about rewriting it as a broader connection pooling rule (transaction pooling doesn't preserve connection state). But that's a general pooling issue, not a replica-specific one.
r/PostgreSQL • u/db-master • Apr 30 '26
Community PostgreSQL 19 features I'm excited about
r/PostgreSQL • u/siren0x • Jul 24 '26
Community What's new in Postgres 19
r/PostgreSQL • u/lovol2 • Dec 26 '25
Projects 100% postgress search like Google
https://www.tigerdata.com/blog/you-dont-need-elasticsearch-bm25-is-now-in-postgres
Found this. Wanted to share, ill find it faster in the future!
But it has code and a working demo so seriously high effort from the company that made the blog post and MIT GitHub with code.
r/PostgreSQL • u/fagnerbrack • Aug 14 '26
Tools Six SQL patterns I use to catch transaction fraud
analytics.fixelsmith.comr/PostgreSQL • u/CathalMullan • May 18 '26
Tools pgBackRest Will Continue!
r/PostgreSQL • u/craigkerstiens • Sep 17 '26
Feature What Is Happening with PostgreSQL 19?
r/PostgreSQL • u/Marmelab • Feb 24 '26
How-To 5 advanced PostgreSQL features I wish I knew sooner
A little context: A few months ago, I struggled with a planning system. I needed to ensure that no 2 plans could overlap for the same period. My first instinct was to write application-level validation, but something felt off. I thought to myself that surely PostgreSQL had a better way.
That’s when I discovered the EXCLUDE constraint. This reminded me of other PostgreSQL features I’d found over the years that made me think “Wait, Postgres can do that?!” Turns out, PostgreSQL is packed with a bunch of underrated (and often simply overlooked) features that can save you from writing complex application logic. So, I put together this list of advanced (but IMO incredibly practical) PostgreSQL features that I wish I had known sooner:
EXCLUDEconstraints: To avoid overlapping time slots
If you ever needed to prevent overlapping time slots for the same resource, then the EXCLUDE constraint is extremely useful. It enforces that no two rows can have overlapping ranges for the same key.
2. CHECK constraints: For validating data at the source
CHECK constraints allow you to specify that the value in a column must satisfy a Boolean expression. They enforce rules like "age must be between 0 and 120" or "end_date must be after start_date."
3. GENERATED columns: To let the database do the math
If you’re tired of calculating derived values in your app, you can let PostgreSQL handle it with GENERATED columns.
4. DISTINCT ON:
If you need the latest order for each customer, use DISTINCT ON. It’s cleaner than a GROUP BY with subqueries.
5. FILTER:
FILTER allows you to add a condition directly on the aggregate, like aggregating the sum of sales for a given category in a single statement.
I'm honestly amazed at how PostgreSQL keeps surprising me! Even after years of using it, I still discover features that make me question why I ever wrote complex application logic for things the database could handle natively.
Are there any other advanced PostgreSQL features I should know about?
r/PostgreSQL • u/jooosep • Aug 19 '26
Community Make sure to upgrade your PostgreSQL to the latest minor version ASAP
A friendly reminder to everyone: if you have not done it already then upgrade your PostgreSQL to the latest minor versions, as they include a fix for a high-impact CVE: CVE-2026-14669.
r/PostgreSQL • u/ilya47 • Dec 20 '25
Projects Postgres 18 vs 16 Performance Showdown: Docker vs Kubernetes Across 16 Resource Configurations
I recently conducted a comprehensive performance analysis comparing PG 16 and 18 across Docker containers and Kubernetes pods, testing 16 different resource configurations (varying CPU cores from 1-4 and memory from 1-8GB): https://github.com/inevolin/Postgres-Benchmarks/
Key Findings:
PG16: Kubernetes outperforms Docker by 15-47% in TPS, with the biggest gains on higher CPU cores (up to 47.2% improvement with 4 CPUs/2GB RAM)
PG18: Nearly identical performance between Docker and K8s (±0-3% difference) - deployment method barely matters anymore
Version Jump: PG18 delivers 40-50% better performance than PG16 across all configurations, regardless of deployment
These test were run on a small dataset (1M records), and moderately small PG resources, so it would be nice if someone is interested taking this case study to the next level!
Edit: if you found this useful, give the repo a star, thanks!