Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Export Database] Produce up-to-date query for ViewCatalogEntry #9375

Merged
merged 10 commits into from
Oct 24, 2023

Conversation

Tishj
Copy link
Contributor

@Tishj Tishj commented Oct 17, 2023

This PR fixes #9367

We regenerate the sql when ToSQL() is called, this is different from before in that all names are provided as explicit aliases.
This is done because name changes of the referenced table is not reflected in the view anyways, so it's fine to just record the names at the time of creation.

This behavior (not letting changes to the referenced query impact the names of the view) is copied from PostgreSQL

@Tishj Tishj requested a review from Mytherin October 17, 2023 13:40
@Mytherin
Copy link
Collaborator

Thanks for the PR! Perhaps it makes sense to, instead of introducing an extra list of aliases (explicit_aliases), rework the way aliases work so that the generated aliases are only added when the view is actually used instead of stored in the ViewCatalogEntry?

@github-actions github-actions bot marked this pull request as draft October 19, 2023 08:30
@Mytherin Mytherin marked this pull request as ready for review October 19, 2023 11:31
Copy link
Collaborator

@Mytherin Mytherin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! Looks good - two more comments:

src/function/table/system/duckdb_columns.cpp Outdated Show resolved Hide resolved
src/function/table/system/pragma_table_info.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot marked this pull request as draft October 20, 2023 14:04
@Tishj Tishj requested a review from Mytherin October 20, 2023 14:21
@Tishj Tishj marked this pull request as ready for review October 20, 2023 14:51
@Mytherin Mytherin merged commit 66be885 into duckdb:main Oct 24, 2023
45 checks passed
@Mytherin
Copy link
Collaborator

Thanks! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export of VIEWs does not respect RENAME
2 participants