cyrilgdn / terraform-provider-postgresql

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

Support for postgresql_view resource #375

Open nguyen1tech opened 7 months ago

nguyen1tech commented 7 months ago

Hi,

In our PG database, there are a lot of views and it is hard to manage them. We're thinking if we can use Terraform to manage all the views in our PG database but after searching around I could not find something like postgresql_view resource. Can we add suport for postgresql_view resource to the provider?

resource "postgresql_view" "my_pg_view" {
      name = "my_pg_view"
      schema = "my_pg_schema"
      query = <<EOF
        SELECT * FROM users WHERE age > 30;
      EOF
}

Thanks!

AndrewJackson2020 commented 1 month ago

Plus one for this feature request. Views are perfect to be deployed via terraform because they have no data.

nguyen1tech commented 1 month ago

I have created a PR for it here: https://github.com/cyrilgdn/terraform-provider-postgresql/pull/442 It's waiting for review now.