Re: improve PQexec documentation - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: improve PQexec documentation
Date
Msg-id 20190412131211.GA7287@alvherre.pgsql
Whole thread Raw
In response to improve PQexec documentation  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: improve PQexec documentation
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Calling pgstat_report_wait_end() before ereport(ERROR)
Next
From: Alvaro Herrera
Date:
Subject: Re: PostgreSQL pollutes the file system