Amazon Redshift adapter behavior changes
The following are the current behavior change flags that are specific to dbt-redshift:
redshift_skip_autocommit_transaction_statements flag
The redshift_skip_autocommit_transaction_statements flag is True by default.
When autocommit=True (the default since dbt-redshift 1.5), each statement is automatically committed by the driver. Previously, dbt still sent explicit BEGIN / COMMIT / ROLLBACK statements, which were unnecessary and added extra round trips to Redshift.
With the redshift_skip_autocommit_transaction_statements flag enabled, dbt skips sending transaction management statements when you enable autocommit, reducing unnecessary round trips and improving performance.
Key behaviors
When both the flag and autocommit are True:
begin()skips sendingBEGINcommit()skips sendingCOMMITrollback_if_open()skips sendingROLLBACK
dbt still maintains its internal transaction_open state to preserve compatibility with dbt’s transaction tracking, even when actual statements are skipped.
Preserving legacy behavior
To preserve the legacy behavior of sending BEGIN/COMMIT/ROLLBACK statements even when autocommit is enabled, set the flag to False in your dbt_project.yml:
flags:
redshift_skip_autocommit_transaction_statements: false
Backward compatibility
autocommit=False: Unchanged. Explicit transactions still work as before regardless of this flag.autocommit=Truewith flag (default): Skips unnecessary transaction statements for better performance.autocommit=Truewithout flag: SendsBEGIN/COMMIT/ROLLBACK(legacy behavior).
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.