Closed tomtaylor closed 7 months ago
You can do exactly that already using the new ATTACH
syntax:
ATTACH 'dbname=postgresscanner' AS postgres_db (TYPE postgres);
USE postgres_db;
BEGIN;
SELECT * FROM postgres_db.tbl1;
...
COMMIT;
Oh, amazing! Thanks!
We use
duckdb
to copy from multiple Postgres tables, against a database that's always moving. It would be really nice if we could open a transaction that would be shared between multiplepostgres_scan
calls, so we can take a consistent snapshot.The way
postgres_scan
takes a transaction and shares that between multiple connections to scan a table is smart, and maybe it would be possible to extend that to work across multiple queries, so we can optionally have aREAD COMMITTED
view of all the Postgres tables in a duckdb session?