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

Feature Request: Implement option to disable transactions #298

Open
daniellietz opened this issue Feb 10, 2025 · 2 comments
Open

Feature Request: Implement option to disable transactions #298

daniellietz opened this issue Feb 10, 2025 · 2 comments

Comments

@daniellietz
Copy link

I think it would make sense to have an option called pg_use_transaction that allows you to disable transactions.

For example, in this issue: #285
not having the option to disable transactions leads to VACUUM not being possible to execute in the attached postgres database.

It could also make sense for this to only affect postgres_query() and postgres_execute(), and not the storage extension part.

I would like to implement this.

@noahisaksen
Copy link

relevant discussion duckdb/duckdb#16187

@tmontes
Copy link

tmontes commented Feb 14, 2025

(chiming in with an additional perspective)

I've very recently bumped into this limitation. The context is an ETL-like dbt-duckdb mini-project that:

  • Reads Parquet data from S3.
  • Computes aggregates.
  • Writes results to a PostgreSQL DB.

I wanted to add a dbt post_hook to trigger a PostgreSQL VACUUM ANALYZE, but it failed due to the underlying in progress transaction.

My contribution/request is, thus, two-fold:

  • I myself would find such an option very useful.
  • It would be lovely if it could be handled in a way that is easily leveraged from within a dbt hook.

Maybe instead of an option, we could have something like CALL postgres_execute('psql', 'VACUUM ANALYZE table', transaction=false) work? This would be a single DuckDB statement with a behaviour along the lines of:

  • Commit the outstanding transaction.
  • Execute the given SQL statement, VACUUM in this case.
  • Begin a new transaction.

My 2c.

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