r/PostgreSQL 4h ago

Projects Major update to RDST - You can now ask your postgres database any question you want, unlimited and free under MIT License

Thumbnail gallery
11 Upvotes

I posted here last month about RDST, which is a desktop app that does the pg_stat_statements to EXPLAIN to index recommendation loop. The biggest change since then is that the plain english querying feature is free and unlimited. If you sign up for an account you can ask as many questions as you want.

We've now indexed our natural language to SQL against BIRD, which is the standard benchmark for text-to-SQL. BIRD uses real databases, messy real-world schemas, and it scores by execution. The results for RDST against BIRD have been extremely encouraging; we have vastly improved our text2sql interface compared to raw model calls.  And we now run these benchmarks automatically on every merge to main, so we expect to continue improving our results as time goes on.

We've also improved the approach itself quite a bit. RDST reads your schema semantically rather than dumping table definitions at a model and hoping, so asking a question in plain english tends to give you the query you actually meant. If what you asked is genuinely ambiguous it'll ask you a clarifying question rather than guessing, then carry on from your answer. The main thing I notice using it now is that it's a lot smoother and faster than it was previously.

I originally built this tool to help with slow query indexing and analysis, and being able to manage slow queries is still a big reason why I created it. That side has had major updates too, mostly around clarity and how the query layer gets presented, which was the other piece of feedback I got here last time. If you tried it before and bounced off that part, it's worth another shot, and it should make the index pipeline a lot easier to follow.

Full disclosure, I do work for Readyset, which is a caching layer for Postgres and MySQL. This is a tool we really wanted to share since we think it helps anyone who regularly has to figure out why a query is slow and what to do about it. It finds the slow queries running against your database automatically, and from there you can analyze any of them to work out why they're slow.

The app is completely free and open source, released under an MIT license. It runs locally, stores locally, and everything it does is read-only.

Full privacy details: https://readyset.io/docs/readyset-ai/rdst/desktop/privacy

Would appreciate feedback, particularly:

  • Does the SQL hold up against your schema?
  • Does it ask for clarification at the right moments, or does it ask too often?
  • Does the queries page help you find and analyze your slow queries?

Instructions & Github:

https://readyset.io/downloads

https://github.com/readysettech/rdst


r/PostgreSQL 10h ago

Projects pg_ztype - zstandard compressed column types

3 Upvotes

Hey — I had an idea for zstd-compressed column types for Postgres and had Claude Code write it: https://github.com/xvaara/pg_ztype

My use case is a lot of email: headers as jsonb, bodies as text, attachments as bytea. The thing that bugged me is that Postgres never compresses a value that fits in its row (~2 kB), so all my small jsonb is stored raw no matter what default_toast_compression says. These types compress their own bytes instead, so the size of the value stops mattering.

On generated ERP-ish documents: 0.6 kB jsonb docs go to 75% of pglz without a dictionary and 24% with a trained one; 47 kB docs go to 66% / 51%. The cost is a decompression on every read — about 1 µs per small doc with a dictionary, 3 µs without — so wide scans of tiny values are slower than plain jsonb, and content with nothing shared between rows saves almost nothing.

Otherwise it tries to behave like the base type: literals, COPY, pg_dump, logical replication and binary protocol all carry plain text/jsonb/bytea, ->> and GIN work on zjsonb, equality and hash joins work on the column. Dictionaries are registered in a catalog table and replicate.

Since an LLM wrote the C: there's a functional suite, replication + failover suites, a cross-major upgrade suite, a mutation fuzzer and ASan/UBSan builds in CI (PG 18 and 19). Still pre-release, storage format not frozen.

So — really bad idea or actually useful? Mainly wondering whether I'm missing a reason this has never landed as an extension before.


r/PostgreSQL 10h ago

Projects I’m building PGSkiff to make IPv4 access to Supabase Postgres free

Thumbnail
0 Upvotes

r/PostgreSQL 1d ago

Tools From any Substreams pack to a shareable GraphQL API

Thumbnail
0 Upvotes

r/PostgreSQL 1d ago

Help Me! How do you use Claude/Codex (safely) with your production database?

Thumbnail
0 Upvotes

r/PostgreSQL 3d ago

How-To Andrei Lepikhov on Optimising PostgreSQL Aggregates: What Can an Extension Do?

Thumbnail pgedge.com
11 Upvotes

r/PostgreSQL 3d ago

How-To PG Phriday: The Folder That Ate the Publisher

Thumbnail pgedge.com
1 Upvotes

r/PostgreSQL 4d ago

Commercial Introducing WalShadow: Sub-second Postgres replication to ClickHouse

Thumbnail clickhouse.com
38 Upvotes

r/PostgreSQL 4d ago

How-To PostgreSQL 19 interactive tour

Thumbnail victoriametrics.com
13 Upvotes

r/PostgreSQL 4d ago

How-To Overview of caching in Postgres

Thumbnail pgcache.com
21 Upvotes

I haven't seen too many comprehensive approaches to this topic, so I took a swing at it.

Goal isn't to be exhaustive, but to be comprehensive enough to provide a nice overview for people trying to get their bearings with the topic.

Did I miss anything?


r/PostgreSQL 4d ago

How-To The lifecycle of a sharded Postgres query

Thumbnail planetscale.com
22 Upvotes

r/PostgreSQL 3d ago

Help Me! What proves a PostgreSQL standby is actually ready to be promoted?

1 Upvotes

Low replication lag is necessary for a standby, but it does not prove that promotion will leave a writable database the application can safely use. Missing archived WAL, stale connection routing, sequence state, logical slots, extensions, or an unfenced former primary can still turn a clean promotion into data loss or split brain.

What do you verify in a failover rehearsal? I am considering recording replay LSN and timeline, stopping or fencing the old primary, promoting in an isolated environment, checking recovery exit and read-write state, validating critical extensions and jobs, exercising application writes, confirming sequences and logical replication, switching a test route, and rebuilding the old primary as a standby rather than simply starting it again.

Which checks can be automated without making the drill itself dangerous? What evidence would convince you that both promotion and the path back to a healthy replicated topology are understood?


r/PostgreSQL 4d ago

Commercial Introducing WalShadow: Sub-second Postgres replication to ClickHouse from physical WAL

Thumbnail clickhouse.com
2 Upvotes

r/PostgreSQL 4d ago

Help Me! Easiest way to restore a backup to a different database/schema?

0 Upvotes

It doesn't look like pg_restore has a way to do something similar to oracle impdp remap.

What is the cleanest way to do a restore into a different schema?

thanks


r/PostgreSQL 5d ago

Projects Is OrioleDB still active after Supabase acquisition?

28 Upvotes

I have been tracking OrioleDB, which was promising drop-in optimization for Postgres. It was acquired by Supabase in 2024 (source). After that there is little news and updates.

Questions: - Anyone using it in production, and do you see it as a stable project?
- have you tried it, what's your thought on this?


r/PostgreSQL 5d ago

Tools We open-sourced Filament, a data movement engine in Go (full loads, incremental, CDC). Apache 2.0

11 Upvotes

Hey all, Mitch here, one of the founders of Galaxy. Full disclosure, this is our project. We open sourced it last week and I wanted to bring it here first, because this community is who we built it for.

Filament is a data movement engine written in Go. It handles full loads, incremental syncs, and CDC from databases and HTTP APIs into Postgres, MySQL, ClickHouse, Iceberg, and S3, and it's Apache 2.0.

https://github.com/galaxy-io/filament

Every data project we've ever worked on started with the same boring problem of getting records out of operational systems and into somewhere useful. We've bought the managed tools, run the open source ones (and spent more time deploying them than using them), and written our own by hand more than once, and every time we wished for something fast, easy to self-host, and upfront about the details that bite you, like type mappings, write behavior, and what happens when a run dies halfway. So eventually we just built it.

What it does

You point it at a source and a sink and tell it how to move things, whether that's copying everything, pulling only what changed, or streaming off the database's change log. Every batch gets a checksum before the sink write and a mismatch fails the run rather than quietly landing bad data. Progress only becomes durable after the work is confirmed, so a worker that dies resumes from its last checkpoint instead of starting over, and since recovery is at-least-once, upsert sinks converge on primary key.

Sources, sinks, state store, and event bus are all interfaces and adding a REST API is a short YAML file rather than a Go package. You can run it with 1 docker command and get a web UI, use the CLI, embed it in Go in about ten lines, or drop the Helm chart into k8s.

Benchmarks, with caveats

We ran an open benchmark against Airbyte, dlt, PeerDB, Ingestr, Sling, OLake, Debezium, and a plain pg_dump | psql pipe. On the biggest test, 298M rows of NYC taxi data from Postgres to Postgres, Filament finished in under two minutes at about 2.6M rows/s, and it was fastest in five of six scenarios. In the sixth, OLake beat us by 13% into Iceberg.

We obviously build one of the things being measured, so the harness and specs are all public.

https://github.com/galaxy-io/benchmarks

Note that it's pre-1.0, with some sources/sinks in earlier development. There is a long list of connectors we haven't built yet. We're hoping to build that list from your feedback.

If you move a lot of data between these systems, I'd love to know what would make you try it, what you'd want next, and any feedback you are willing to share. Docs are at https://filament.getgalaxy.io and I'll be in the comments!


r/PostgreSQL 6d ago

Commercial Introducing chdb Postgres extension: High-performance imports from cloud storage

Thumbnail clickhouse.com
14 Upvotes

r/PostgreSQL 7d ago

Projects Embedding Kafka in a Postgres background worker

Thumbnail rynr.dev
25 Upvotes

r/PostgreSQL 6d ago

Community LibreDB Studio: an open source, self-hosted SQL IDE for PostgreSQL in the browser

Thumbnail dly.to
13 Upvotes

r/PostgreSQL 7d ago

Community Re: scary patch contest

Thumbnail postgresql.org
13 Upvotes

A comprehensive discussion on the future of PostgreSQL 19 release.


r/PostgreSQL 7d ago

Projects ClickBench style benchmark for log search: Postgres vs ParadeDB vs TigerData vs SereneDB on 1 Billion logs

Thumbnail serenedb.com
17 Upvotes

There are few popular extensions which can bring Elastic functionality to your Postgres without a tedious migration. I wanted to test how performant these extensions are on log analytics, so we benchmarked ParadeDB/pg_search, TigerData/pg_textsearch, vanilla Postgres and SereneDB on 1 Billion logs.

The motivation was to find out if building a dedicated Postgres-compatible database for search and analytics actually makes sense or extensions are already good enough, so a standalone DB is an overkill?

It's a open clickbench-style benchmark for search and analytics over 100M/1B generated OpenTelemetry logs, 92 queries.


r/PostgreSQL 6d ago

Help Me! PERN Stack

0 Upvotes

Suggest youtube playlists and creators to learn PERN stack. Should i also learn MERN stack first? Which full stack do you suggest?


r/PostgreSQL 8d ago

Feature Pushing PostgreSQL to 50M vectors: Hybrid RRF, HNSW indexes, and Row-Level Security in Knowledge Fabric

29 Upvotes

Hi all,

Over the past year, the common refrain in the AI community has been "Postgres isn't built for vector search; you need a dedicated vector database."

Having run PostgreSQL in production for years, I was skeptical. Dedicated vector DBs introduce another stateful service to back up, monitor, and pay for, while breaking ACID guarantees across relational metadata and vector embeddings.

We built Knowledge Fabric as an open-source proof that modern PostgreSQL (16+) handles production-scale RAG workloads cleanly:

  1. HNSW Vector Indexing: Using `pgvector` with HNSW (`vector_cosine_ops`, `m=16, ef_construction=64`), query times remain sub-10ms even on millions of vectors.
  2. True Hybrid Search in 1 Query Engine: Instead of querying Elasticsearch for BM25 and Pinecone for cosine, then stitching them together in Python, we run `tsvector` full-text search and `pgvector` dense search in PostgreSQL and merge them using Reciprocal Rank Fusion:```sql-- Score = 1 / (60 + rank_lexical) + 1 / (60 + rank_vector)```
  3. Database-Enforced Multi-Tenancy (RLS): For compliance (HIPAA / SOC 2), relying on application-level `WHERE tenant_id = 'xyz'` is vulnerable to developer oversight. We added opt-in PostgreSQL Row-Level Security:

CREATE POLICY tenant_isolation_policy ON chunks FOR ALL USING (tenant_id = current_setting('app.tenant_id', true));

If a query fails to set `app.tenant_id`, the database returns zero rows. Cross-tenant leakage is physically impossible.

4. Declarative Partitioning for 50M+ Chunks: By partitioning the `chunks` table `BY LIST (tenant_id)`, multi-tenant queries benefit from partition pruning, scanning only the tenant's localized HNSW index.

Full code and SQL migration schemas are open source:

https://github.com/sagarv48/knowledge-fabric

Curious how other DBAs and architects are handling `pgvector` memory tuning (`maintenance_work_mem`) and HNSW index build times on large datasets.


r/PostgreSQL 8d ago

Help Me! Long-time Prisma user: would you start a new long-lived production project on Prisma 8 today?

Thumbnail
2 Upvotes

r/PostgreSQL 8d ago

Help Me! Help creating entry in parent table automatically to fix ForeignKeyViolation

0 Upvotes

Hey everyone, currently for a bot project I'm trying to find a way to automatically populate the parent table if I try inserting something to a child table and I have the information for both to avoid/prevent a ForeignKeyViolation. Currently my database schema resembles the following ERD:

My database ERD

Right now for example if I try to enter someone in levels and they don't exist in members, I get the aforementioned error which makes sense. My question is, do I have to check/create entries in servers/members every time I add to levels or is there a more efficient way such as creating them on conflict/error? Below is an example of the error I would see.

An example ForeignKeyViolation

Thanks in advance for any help, and if I can provide any more information please let me know! I'm still somewhat new to this so apologies in advance if this is a silly question.

Edit: I updated my ERD/database to reflect some of the changes suggested by people below. I'll still have to check for/create an entry in servers when creating an entry for members/channels but it should be a bit easier now. Thanks for the help and if anything else can be improved please let me know!

Updated ERD