On Mon, Apr 15, 2024 at 10:24 AM Jan Behrens <jbe-ml...@magnetkern.de> wrote:
> On Wed, 10 Apr 2024 19:02:48 -0400 > Tom Lane <t...@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