iam=> select * from pg_publication_tables;
pubname | schemaname | tablename
------------------------------------+------------+------------------------
...
airbyte_publication_prod_iam_admin | public | Nationality
but we have always a change in the plan:
# module.postgres-shared-prod-live.postgresql_publication.publication["iam"] will be updated in-place
~ resource "postgresql_publication" "publication" {
id = "iam.airbyte_publication_prod_iam_admin"
name = "airbyte_publication_prod_iam_admin"
~ tables = [
- "public.Nationality",
+ "public.\"Nationality\"",
# (16 unchanged elements hidden)
]
# (6 unchanged attributes hidden)
}
If we set the table name like that: "public.Nationality", we have that:
iam=> select * from pg_publication_tables;
pubname | schemaname | tablename
------------------------------------+------------+------------------------
...
airbyte_publication_prod_iam_admin | public | nationality
we make a dirty fix to not be blocked in our provisioning:
re := regexp.MustCompile(`public\.(\w+)`)
for _, p := range added {
query := fmt.Sprintf("ALTER PUBLICATION %s ADD TABLE %s", pubName, re.ReplaceAllString(p.(string), "public.\"$1\""))
queries = append(queries, query)
}
for _, p := range dropped {
query := fmt.Sprintf("ALTER PUBLICATION %s DROP TABLE %s", pubName, re.ReplaceAllString(p.(string), "public.\"$1\""))
log.Printf(query)
queries = append(queries, query)
}
Do you have any idea how we can fix that ?
Thanks.
Thank you for opening an issue. Please provide the following information:
Terraform Version
Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
v1.5.6
Affected Resource(s)
Please list the resources as a list, for example:
postgresql_publication
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Hi there, we try to create a
postgresql_publication
with Uppercase tables names.Like that:
It works:
but we have always a change in the plan:
If we set the table name like that:
"public.Nationality"
, we have that:we make a
dirty
fix to not be blocked in our provisioning:Do you have any idea how we can fix that ? Thanks.
Thank you for opening an issue. Please provide the following information:
Terraform Version
Run
terraform -v
to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.v1.5.6
Affected Resource(s)
Please list the resources as a list, for example:
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Actual Behavior
Steps to Reproduce
References