Re: Allow an alias to be attached directly to a JOIN ... USING
От | Peter Eisentraut |
---|---|
Тема | Re: Allow an alias to be attached directly to a JOIN ... USING |
Дата | |
Msg-id | d173356b-8ee7-8036-0f17-04d196494143@2ndquadrant.com обсуждение исходный текст |
Ответ на | Re: Allow an alias to be attached directly to a JOIN ... USING (Vik Fearing <vik.fearing@2ndquadrant.com>) |
Ответы |
Re: Allow an alias to be attached directly to a JOIN ... USING
Re: Allow an alias to be attached directly to a JOIN ... USING |
Список | pgsql-hackers |
On 2019-12-31 00:07, Vik Fearing wrote: > One thing I notice is that the joined columns are still accessible from > their respective table names when they should not be per spec. That > might be one of those "silly restrictions" that we choose to ignore, but > it should probably be noted somewhere, at the very least in a code > comment if not in user documentation. (This is my reading of SQL:2016 SR > 11.a.i) Here is a rebased patch. The above comment is valid. One reason I didn't implement it is that it would create inconsistencies with existing behavior, which is already nonstandard. For example, create table a (id int, a1 int, a2 int); create table b (id int, b2 int, b3 int); makes select a.id from a join b using (id); invalid. Adding an explicit alias for the common column names doesn't change that semantically, because an implicit alias also exists if an explicit one isn't specified. I agree that some documentation would be in order if we decide to leave it like this. Another reason was that it seemed "impossible" to implement it before Tom's recent refactoring of the parse namespace handling. Now we also have parse namespace columns tracked separately from range table entries, so it appears that this would be possible. If we want to do it. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Вложения
В списке pgsql-hackers по дате отправления: