public inbox for [email protected]  
help / color / mirror / Atom feed
From: Merlin Moncure <[email protected]>
To: Jan Behrens <[email protected]>
Cc: [email protected]
Cc: Tom Lane <[email protected]>
Subject: Re: (When) can a single SQL statement return multiple result sets?
Date: Mon, 15 Apr 2024 17:16:47 -0500
Message-ID: <CAHyXU0z0PfBLQFp+QaxyW5UmkCgcxJ-+0_wo6FdexyzQmsJoAQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>

On Mon, Apr 15, 2024 at 10:24 AM Jan Behrens <[email protected]>
wrote:

> On Wed, 10 Apr 2024 19:02:48 -0400
> Tom Lane <[email protected]> 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


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: (When) can a single SQL statement return multiple result sets?
  In-Reply-To: <CAHyXU0z0PfBLQFp+QaxyW5UmkCgcxJ-+0_wo6FdexyzQmsJoAQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox