cyrilgdn / terraform-provider-postgresql

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

Support for `postgresql_columns` data source #410

Open hroost opened 4 months ago

hroost commented 4 months ago

Hi there,

It would be great to have support for a postgresql_columns data source as well as postgresql_databases.

374

Thanks

cyrilgdn commented 4 months ago

Hi @hroost ,

How do you imagine this data source? Getting all columns of a specific table? Only the columns names?

Thanks

hroost commented 3 months ago

Hi @cyrilgdn ,

I suggest a data source that returns column lists for requested table:

data "postgresql_columns" "my_columns" {
  database = "my_database"
  schema = "my_schema"
  table = "my_table"
}

Result: [column1, column2, ... columnN]

Sorry for delay and thanks for this module!