-
Notifications
You must be signed in to change notification settings - Fork 57
Add use_transaction
parameter for postgres_query()
and postgres_execute()
#310
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
Add use_transaction
parameter for postgres_query()
and postgres_execute()
#310
Conversation
Create postgres_query_use_transaction.test
I am not sure why the pipeline is failing. The failures seem independent of the changes made in this PR. I have tried to bump DuckDB to v1.2.1 in the most recent commit. |
Really looking forward for this change to land. Currently post-hook using postgres_execute break due to transaction read level enforcement. |
I've fixed the CI in #320 - could you merge with main so this can re-run? |
I acknowledge this may be a slight feature creep, but would it be possible to set a transaction isolation level as well during postgres_query and postgres_query. REPEATABLE READ is a nice default, but in some instances you need a stronger guarantee like We are in need of having stronger guarantees for reads. |
Thanks! |
Could you open a separate issue for this? We could implement this - but I think it should be implemented as a configuration option. |
Fixes #298
use_transaction
is an optional named parameter and set to true by default. If it is not mentioned, no behavior changes.Not allowed to be turned off in read-only mode or inside an ongoing DuckDB transaction.
When turned off explicitly, it allows to execute queries that are not encapsulated by a transaction.
This allows to run operations such as
VACUUM
on your attached postgres database and gives you more control as to whether you want to use transactions in your queries or not.Sample output: