Re: BUG #6067: In PL/pgsql, EXISTS(SELECT ... INTO...) fails

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #6067: In PL/pgsql, EXISTS(SELECT ... INTO...) fails
Дата
Msg-id 24370.1308429051@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #6067: In PL/pgsql, EXISTS(SELECT ... INTO...) fails  ("David Fetter" <dfetter@vmware.com>)
Ответы Re: BUG #6067: In PL/pgsql, EXISTS(SELECT ... INTO...) fails  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-bugs
"David Fetter" <dfetter@vmware.com> writes:
>     IF EXISTS (SELECT 1 INTO STRICT i) THEN
>         RAISE NOTICE '%', a;
>     END IF;

Umm ... are you just complaining that the error message isn't very
helpful, or are you actually expecting that to do something useful?
If the latter, what exactly?  I'm particularly confused by your use
of the STRICT option here, because if we did support that, I would
expect the STRICT to throw an error if there were not exactly one
matching row, making the EXISTS test 100% pointless.

But the short answer is that we don't support INTO in sub-selects,
and in general I doubt that we ever will, since in most cases the
behavior wouldn't be very well-defined.  It might be worth a TODO
to provide a better error message than "syntax error", though.

            regards, tom lane

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: BUG #6067: In PL/pgsql, EXISTS(SELECT ... INTO...) fails
Следующее
От: "Jeff Janes"
Дата:
Сообщение: BUG #6068: automatic analyze runs endlessly