You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this feature
I am requesting a straightforward extension of existing dbt-postgres functionality, rather than a Big Idea better suited to a discussion
Describe the feature
The macro postgres__get_columns_in_relation (link) only looks at the information_schema.columns to get the column names for the particular relation. This doesn't work for materialized views because information_schema.columns doesn't include information about materialized views. I think that adaptor macro could be enhanced to account for this and potentially look at pg_attribute (docs) instead. Based on this Stack Overflow it looks like its possible. I'm happy to research some more if that's helpful.
Describe alternatives you've considered
I considered reporting this as a bug but I think its more of a feature request. I imagine the information schema choice was intentional and maybe there is something I'm not considering about pg_attribute that you all have already considered that makes it unfeasible. In that case I'd propose documenting this nuance for postgres.
Who will this benefit?
Anyone using the dbt_utils.star macro with postgres (like I was)
Are you interested in contributing this feature?
I'm happy to contribute if this request is accepted
Anything else?
No response
The text was updated successfully, but these errors were encountered:
@drewblinn it looks like yes. The implementation of the PR I didn't fully check, but I can look to see if it will cover what I'm looking for (it looks like it intends to). The way I went about it for my custom macro was that I queried the information schema for non-materialized views and pg_attribute only for MVs.
Double checked, the PR looks right to me. Although it looks like that was aimed at dbt-core and the adaptors have been decoupled from dbt-core and so those changes would be better served in this module (dbt-postgres).
I also overrode it in our project, but I'll get a PR together to roll these changes out to dbt-postgres the the entire community can reap the benefits! @adase11
Is this your first time submitting a feature request?
Describe the feature
The macro
postgres__get_columns_in_relation
(link) only looks at theinformation_schema.columns
to get the column names for the particular relation. This doesn't work for materialized views becauseinformation_schema.columns
doesn't include information about materialized views. I think that adaptor macro could be enhanced to account for this and potentially look atpg_attribute
(docs) instead. Based on this Stack Overflow it looks like its possible. I'm happy to research some more if that's helpful.Describe alternatives you've considered
I considered reporting this as a bug but I think its more of a feature request. I imagine the information schema choice was intentional and maybe there is something I'm not considering about
pg_attribute
that you all have already considered that makes it unfeasible. In that case I'd propose documenting this nuance for postgres.Who will this benefit?
Anyone using the
dbt_utils.star
macro with postgres (like I was)Are you interested in contributing this feature?
I'm happy to contribute if this request is accepted
Anything else?
No response
The text was updated successfully, but these errors were encountered: