duckdb_fdw icon indicating copy to clipboard operation
duckdb_fdw copied to clipboard

concurrent read&write

Open 1991jhf opened this issue 1 year ago • 2 comments

does it support concurrent read? If i try to read same table from two different processes, one of the processes will fail.

WARNING: terminating connection because of crash of another server process DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. HINT: In a moment you should be able to reconnect to the database and repeat your command. server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.

1991jhf avatar Mar 17 '24 09:03 1991jhf

DuckDB does not support it, feel free have a look https://duckdb.org/docs/connect/concurrency#writing-to-duckdb-from-multiple-processes

alitrack avatar Apr 05 '24 15:04 alitrack

@alitrack , it does seem like duckdb does support multiple concurrent reads from different processes if a read only flag is set. https://github.com/duckdb/duckdb/issues/1343

I am experiencing the same problem as others have reported where the duckdb database file is in use by another connection. I am nor sure how difficult it would be to implement, but just a suggestion that it would be great if the create server command had an option to specify connections should be read only. Maybe it would then be possible to have a single foreign server created that has a writeable connection and another that is read only. That way, one could still import data, create tables and make changes to the duckdb database using one foreign server reference and other users could still access the database using the foreign server that only has read only connections.

SQL Error [HV00N]: ERROR: failed to open SQLite DB. rc=1 path=/data/postgres/duckdb/sds.db

Thank you, Chris Whelan

chrisfw avatar Aug 09 '24 17:08 chrisfw