Re: (When) can a single SQL statement return multiple result sets?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: (When) can a single SQL statement return multiple result sets?
Дата
Msg-id CAHyXU0z0PfBLQFp+QaxyW5UmkCgcxJ-+0_wo6FdexyzQmsJoAQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: (When) can a single SQL statement return multiple result sets?  (Jan Behrens <jbe-mlist@magnetkern.de>)
Список pgsql-general
On Mon, Apr 15, 2024 at 10:24 AM Jan Behrens <jbe-mlist@magnetkern.de> wrote:
On Wed, 10 Apr 2024 19:02:48 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> > Here, "DELETE FROM magic" returns multiple result sets, even though it
> > is only a single SQL statement.
>
> Right, so it's kind of a case that you have to support.  We're not
> likely to rip out rules anytime soon, even if they're a bit
> deprecated.

As it seems to be a corner case that rarely occurs in practice, I was
considering to simply not support this case in my client library. I
don't know which SQL error code I could return in that case though.
Maybe "0A000" (feature_not_supported) or
"21000" (cardinality_violation). Not sure if either of those is a good
choice. Any better idea?

If you are asking if "rules" can be ignored or error-walled in terms of your library design, I'd say yes.  100% yes.   

The main caveat would then be the proposed multi-resultset stored procedure feature, which might break the 'one result per semicolon' assumption you might be chasing as it has some basis in the standard, so I'd be balancing risk/reward against that feature IMO if I were you.

merlin

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Failing streaming replication on PostgreSQL 14
Следующее
От: Christoph Berg
Дата:
Сообщение: Re: Obsolete Linux downloads (Debian) instructions