Re: BUG #15088: Can create subquery with duplicate column names

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #15088: Can create subquery with duplicate column names
Дата
Msg-id CAKFQuwa74o+ZTe6mhY3bRRqdMa6kup8gfnzaudzF96wFEZYGpg@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #15088: Can create subquery with duplicate column names  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
On Sunday, February 25, 2018, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      15088
Logged by:          Tudor Bosman
Email address:      tudorb@gmail.com
PostgreSQL version: 9.5.11
Operating system:   Ubuntu 16.04
Description:

This may not be a bug, but you can create a subquery that has ambiguous
column names, and then you have no way to disambiguate between them, as the
originating table names are no longer in scope.


[...] 
... and the result now has two columns named x, and I can't tell them
apart:


That is correct, though with a result you (in client software) can target a column number in lieu of a name so all hope is not lost.  PostgreSQL won't let you create table or create view from such a result though, only a result set.

At this point backward compatibility will prevent changing the behavior regardless of its individual merit.  And its (usually) obvious and easy to fix if you do get presented with said error.

David J.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: BUG #15088: Can create subquery with duplicate column names
Следующее
От: Greg Clough
Дата:
Сообщение: RE: BUG #15067: Documentation or behaviour bug with autovacuumthresholds?