cyrilgdn / terraform-provider-postgresql

Terraform PostgreSQL provider
https://www.terraform.io/docs/providers/postgresql/
Mozilla Public License 2.0
397 stars 204 forks source link

postgresql_database search_path #434

Open OJFord opened 7 months ago

OJFord commented 7 months ago

[Removed the template because not a bug]

Currently it doesn't seem to be possible to set the database-level search_path on the postgresql_database resource; it's necessary to create the resource and then connect and ALTER DATABASE dbname SET search_path TO schema1,schema2,schema3; some other way afterwards.

It would be good to have a list(string) argument on postgresql_database to set this instead:

resource "postgresql_database" "db" {
  name = "dbname"
  owner = "me"
  search_path = [
    "\"$user\"",
    "public",
    "myadditionalschema",
  ]
}

Hope to have a PR shortly.

OJFord commented 7 months ago

Hope to have a PR shortly.

Actually, sorry, but since I just found it is supported on the role I can do it like that for now. I might still get around to it though :slightly_smiling_face: