On Sun, 8 Sep 2002, Steve Howe wrote:
> Here are the proposals for solutioning the "Return proper effected
> tuple count from complex commands [return]" issue as seen on TODO.
>
> Any comments ?... This is obviously open to voting and discussion.
As it seems we're voting, I think Tom's scheme is about as good
as we'll do for the current API. I actually think that a better API
is a good idea, but it's an API change and we're in beta, so not
for 7.3.
I'm not 100% sure which of the PQcmdTuples behaviors makes sense (actually
I'm pretty sure neither do, but since the general complaint is knowing
whether something happened or not, sum gets around the last statement
doing 0 rows and running into the same type of problem).
> Proposal #2 (author: Tom lane):
> ---------------------------------
>
> Tom Lane's proposal, as posted on
> http://candle.pha.pa.us/mhonarc/todo.detail/return/msg00012.html,
> consists basically on the following:
>
> PQcmdStatus() ==> Should always return the same command type original
> submitted by the client.
>
> PQcmdTuples() ==> If no INSTEAD rule, return same output as for
> original command, ignoring other commands in the
> rule.If there is INSTEAD rules, use result of last
> command in the rewritten series, use result of last
> command of same type as original command or sum up
> the results of all the rewritten commands.
>
> (I particularly prefer the sum).
>
> PQoidValue() ==> If the original command was not INSERT, return 0.
> otherwise, if one INSERT, return it's original
> PQoidValue(). If more then one INSERT command
> applied, use last or other possibilities (please
> refer to the thread for details).
>
> Please refer to the original post to refer to the original message. I
> would like to point out that it was the most consistent proposal
> pointed out until now on the previous discussions (Bruce M. agrees
> with this one).