Skip to content

Commit

Permalink
Dynamic default incremental_strategy for dbt-postgres and dbt-redsh…
Browse files Browse the repository at this point in the history
…ift (#4652)

resolves #4651

### Previews
- [dbt-postgres
configs](https://docs-getdbt-com-git-dbeatty-dynamic-default-pos-c89442-dbt-labs.vercel.app/reference/resource-configs/postgres-configs#incremental-materialization-strategies)
- [dbt-redshift
configs](https://docs-getdbt-com-git-dbeatty-dynamic-default-pos-c89442-dbt-labs.vercel.app/reference/resource-configs/redshift-configs#incremental-materialization-strategies)

## What are you changing in this pull request and why?

The default `incremental_strategy` for dbt-postgres and dbt-redshift is
dynamic!

It depends on [if `unique_key` is defined or
not](#4633):
- `delete_insert` when there is a unique_key defined and `append`
otherwise

All other adapters have a static default `incremental_strategy`.

## 🎩 

<img width="400" alt="image"
src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/ba97b2cc-76e2-41d9-a8af-e1aeebb23a2d">

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
  • Loading branch information
matthewshaver authored Dec 14, 2023
2 parents dd853c9 + 7c252ce commit c9b6cfd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions website/docs/reference/resource-configs/postgres-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ In dbt-postgres, the following incremental materialization strategies are suppor

<VersionBlock lastVersion="1.5">

- `append` (default)
- `delete+insert`
- `append` (default when `unique_key` is not defined)
- `delete+insert` (default when `unique_key` is defined)

</VersionBlock>

<VersionBlock firstVersion="1.6">

- `append` (default)
- `append` (default when `unique_key` is not defined)
- `merge`
- `delete+insert`
- `delete+insert` (default when `unique_key` is defined)

</VersionBlock>

Expand Down
10 changes: 5 additions & 5 deletions website/docs/reference/resource-configs/redshift-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ In dbt-redshift, the following incremental materialization strategies are suppor

<VersionBlock lastVersion="1.5">

- `append` (default)
- `delete+insert`
- `append` (default when `unique_key` is not defined)
- `delete+insert` (default when `unique_key` is defined)

</VersionBlock>

<VersionBlock firstVersion="1.6">

- `append` (default)
- `append` (default when `unique_key` is not defined)
- `merge`
- `delete+insert`
- `delete+insert` (default when `unique_key` is defined)

</VersionBlock>

Expand Down

0 comments on commit c9b6cfd

Please sign in to comment.