Error when specifying primary key in Terraform for Postgres connection with sync type incremental_dedup_history


When trying to specify a primary key in a stream for a Postgres connection with a sync type of incremental_dedup_history in Terraform, users encounter errors where they are told not to include a primary key configuration, but then prompted to specify one. Resolving this by using “primary_key”: still results in a Terraform error related to unexpected new values.


When I use terraform and try to specify a primary key in a stream for a postgres connection with a sync type of incremental_dedup_history i get

│ key for stream: plans is already pre-defined. Please do NOT include a
│ primary key configuration for this stream```
however, if i do not specify a primary key it tells me I must specify a primary key.  I can get past this by specifying:
```"primary_key": []```
however, this still gives a terraform error:
```When applying changes to
│ airbyte_connection.massdriver_workfront_teams_to_redshift, provider
│ "provider[\"<\|\>"]" produced an
│ unexpected new value: .configurations.streams[0].primary_key: new element 0
│ has appeared.
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.```



This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. [Click here]( if you want to access the original thread.

[Join the conversation on Slack](

["terraform", "primary-key", "postgres-connection", "sync-type", "incremental-dedup-history", "error", "provider-bug"]

hit very similar issues this week with postgres -> redshift connections

thanks! i’ll post on your issue

sounds like it’s all the same root cause - the provider stores more in state than it should be

i also posted an issue directly on the terraform provider github

ah ha, good to know there’s a separate repo