You have a table in PostgreSQL and a CSV on your desktop, and you need them together. Here's how to JOIN them in a single SQL query — without importing the file or standing up a pipeline.
orders table joined to two CSV files in one query — run locally on DuckDB.\copy into a staging table — load the CSV into PostgreSQL first, then join. Works, but you own a throwaway table and the data is a stale copy.file_fdw foreign data wrapper — powerful, but needs server-side setup, superuser rights, and a fixed file path on the database host.What you actually want is to treat the file as a table and write a normal join.
Varan runs a local-first DuckDB engine that can read your PostgreSQL database and your CSV files at the same time, so a single JOIN spans both — read-only, on your machine, with nothing written back.
SELECT c.name, c.country, s.tier,
COUNT(o.id) AS orders,
SUM(o.total) AS revenue
FROM customers c -- customers.csv on disk
JOIN pg__orders o ON o.customer_id = c.id -- PostgreSQL table
JOIN segments s ON s.customer_id = c.id -- segments.csv on disk
GROUP BY c.name, c.country, s.tier
ORDER BY revenue DESC;
Varan is a desktop app for macOS, Windows and Linux — free during the beta.
Request beta access →Yes — Varan reads the file at query time and joins it to PostgreSQL live, so there's no import and no staging table.
Same approach — see how to join tables from different databases.
A normal client connects to one database and can't see a file as a table. See Varan vs DBeaver and Varan vs TablePlus.