Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

concurrent read&write #40

Open
1991jhf opened this issue Mar 17, 2024 · 2 comments
Open

concurrent read&write #40

1991jhf opened this issue Mar 17, 2024 · 2 comments

Comments

@1991jhf
Copy link

1991jhf commented Mar 17, 2024

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.

@alitrack
Copy link
Owner

alitrack commented Apr 5, 2024

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

@chrisfw
Copy link

chrisfw commented Aug 9, 2024

@alitrack , it does seem like duckdb does support multiple concurrent reads from different processes if a read only flag is set.
duckdb/duckdb#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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants