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
How to handle * in case of ddl (specifically adding column) is not yet considered
example: create table t(x int); create view v as select * from t; alter table t add column y int; In PG, v only outputs x without y. This means * is resolved before the view is stored. This behavior is expected also because we can specify column names when creating views. It only makes sense if the view outputs fixed number of columns.
The difficulty is that * is resolved in binder, but after binding, we can't restore the BoundQuery to AST and unparse it. One solution is to serializing plan instead of sql, but as discussed earlier we don't want to persist plan because it may be subject to change. Another solution is to rewriting AST while binding, but it may be a little bit hacky.
The text was updated successfully, but these errors were encountered:
Original posted at #6023
How to handle * in case of ddl (specifically adding column) is not yet considered
example:
create table t(x int); create view v as select * from t; alter table t add column y int;
In PG,v
only outputsx
withouty
. This means*
is resolved before the view is stored. This behavior is expected also because we can specify column names when creating views. It only makes sense if the view outputs fixed number of columns.The difficulty is that
*
is resolved in binder, but after binding, we can't restore theBoundQuery
to AST and unparse it. One solution is to serializing plan instead of sql, but as discussed earlier we don't want to persist plan because it may be subject to change. Another solution is to rewriting AST while binding, but it may be a little bit hacky.The text was updated successfully, but these errors were encountered: