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

Support for `postgresql_columns` data source

Open hroost opened this issue 1 year ago • 2 comments

Hi there,

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

#374

Thanks

hroost avatar Feb 19 '24 18:02 hroost

Hi @hroost ,

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

Thanks

cyrilgdn avatar Feb 25 '24 13:02 cyrilgdn

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!

hroost avatar Mar 07 '24 20:03 hroost