Skip to main content

Amazon Redshift adapter behavior changes

The following are the current behavior change flags that are specific to dbt-redshift:

Flagdbt-redshift: Introdbt-redshift: MaturityStatus
redshift_skip_autocommit_transaction_statements1.12.0TBDActive

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 sending BEGIN
  • commit() skips sending COMMIT
  • rollback_if_open() skips sending ROLLBACK

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:

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=True with flag (default): Skips unnecessary transaction statements for better performance.
  • autocommit=True without flag: Sends BEGIN/COMMIT/ROLLBACK (legacy behavior).

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0
Loading