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

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: BUG #6067: In PL/pgsql, EXISTS(SELECT ... INTO...) fails
Дата
Msg-id CA+TgmoZC9vwRD0rJVFE5rG4HtWQCZ9S9WSHb8nHyRBDtsPUQ2Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #6067: In PL/pgsql, EXISTS(SELECT ... INTO...) fails  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: BUG #6067: In PL/pgsql, EXISTS(SELECT ... INTO...) fails  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-bugs
On Tue, Nov 29, 2011 at 9:32 PM, Bruce Momjian <bruce@momjian.us> wrote:
> Tom Lane wrote:
>> "David Fetter" <dfetter@vmware.com> writes:
>> > =A0 =A0 IF EXISTS (SELECT 1 INTO STRICT i) THEN
>> > =A0 =A0 =A0 =A0 RAISE NOTICE '%', a;
>> > =A0 =A0 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? =A0I'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. =A0It might be worth a TODO
>> to provide a better error message than "syntax error", though.
>
> Is it worth documenting, fixing, or adding this to the TODO list?

At most I would say we could try to improve the error message.

--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #6064: != NULL, <> NULL do not work [sec=UNCLASSIFIED]
Следующее
От: Jeff Davis
Дата:
Сообщение: possible bug seen with -DCLOBBER_CACHE_ALWAYS and changing GUCs