terraform-provider-postgresql icon indicating copy to clipboard operation
terraform-provider-postgresql copied to clipboard

Support for postgresql_view resource

Open nguyen1tech opened this issue 1 year ago • 2 comments

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!

nguyen1tech avatar Nov 29 '23 10:11 nguyen1tech

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

AndrewJackson2020 avatar May 21 '24 11:05 AndrewJackson2020

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

nguyen1tech avatar May 25 '24 17:05 nguyen1tech