RAG With Only Postgres: Vectors, Keyword Search and Fusion in One Database
A former Oracle DBA describes building a retrieval-augmented generation system using only Azure Database for PostgreSQL Flexible Server, avoiding a separate vector database. The author argues that a second database adds copies of data, sync jobs, extra permissions, and inconsistent backups. The schema stores text, embeddings, a generated full-text column, and metadata in one table, so ingestion and point-in-time restore keep everything consistent. Because vector search handles meaning while keyword search handles exact tokens, the approach combines both using Reciprocal Rank Fusion, implemented as a single SQL function. The author verified the SQL output against a plain Python version with an integration test.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in