Re: BUG #2123: join between stored procedures

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2123: join between stored procedures
Дата
Msg-id 23007.1135696528@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2123: join between stored procedures  ("Konstantin S. Zhinko [tIT]" <k.zhinko@grape.ru>)
Список pgsql-bugs
"Konstantin S. Zhinko [tIT]" <k.zhinko@grape.ru> writes:
> SELECT b.*
> FROM get_obj_list a
>   LEFT JOIN get_obj(a.id) b ON 1=1
> Error: relation "a" does not exists.

This is not a bug.  You cannot make use of values from one <table
reference> inside the definition of another <table reference>.
So the reference "a.id" is taken to be to a real table named "a",
not to the "a" alias elsewhere in the query.

You could do something like

    SELECT (get_obj(id)).* FROM get_obj_list();

instead.

            regards, tom lane

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

Предыдущее
От: gotomoon gotomoon
Дата:
Сообщение: Re: BUG #2118: could not connect to server [From zhuge xiao ]
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2102: Backend reports wrong number of affected rows for a