Re: Why won't nested select-into expression work?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why won't nested select-into expression work?
Дата
Msg-id 14327.1290541119@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Why won't nested select-into expression work?  (Leon Starr <leon_starr@modelint.com>)
Ответы Re: Why won't nested select-into expression work?  (Leon Starr <leon_starr@modelint.com>)
Список pgsql-novice
Leon Starr <leon_starr@modelint.com> writes:
> I tried this and it failed (see embedded comments):

>         select * into my_paragraph from paragraph where
>             form = p_form and
>             number = ( select method_paragraph_new( p_form, 0, p_append ) );
>             -- Inner expression above inserts a new row in the 'paragraph' table which
>             -- just happens to be the one I want selected by the outer select-into expression

You're apparently expecting that the row inserted by
method_paragraph_new() will be seen by the already-in-progress outer
query?  That won't happen.  A SELECT will only see rows that exist
when it starts execution.  This is a feature, not a bug.

            regards, tom lane

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

Предыдущее
От: Leon Starr
Дата:
Сообщение: Why won't nested select-into expression work?
Следующее
От: Leon Starr
Дата:
Сообщение: Why won't nested select-into expression work?