On 2019-Apr-12, Fabien COELHO wrote:
> I'm looking at psql's use of PQexec for implementing some feature.
>
> When running with multiple SQL commands, the doc is not very helpful.
>
> From the source code I gathered that PQexec returns the first COPY results
> if any, and if not the last non-empty results, unless all is empty in which
> case an empty result is returned.
I'm not sure we necessarily want to document this behavior. If it was
super helpful for some reason, or if we thought we would never change
it, then it would make sense to document it in minute detail. But
otherwise I think documenting it sets a promise that we would (try to)
never change it in the future, which I don't necessarily agree with --
particularly since it's somewhat awkward to use.
I'm inclined to reject this patch.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services