Support select *
for postgres parser
#423
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR resolves the error in #397. However, there is a problem as follows.
No matter how many times
psqldef
is executed,CREATE OR REPLACE VIEW
is executed. It seems that the cause is that whenselect *
is specified, the query is saved as a query with expanded columns.Therefore, it becomes as follows:
currentDDL
:SELECT t.col1, t.col2
desiredDDL
:SELECT t.*
As a result, the comparison fails. This seems to be the same not only for postgres but also for mysql. I have confirmed that the same phenomenon occurs with
mysqldef
.To solve this problem, we need a process to expand
*
when parsingdesiredDDL
. This is not impossible, but it seems to take time. Another option is to have sqldef output an error that it does not support*
and exit until this problem is solved.@k0kubun Which do you think is better?