Thread: Undocumented PQdisplayTuples and PQprintTuples in libpq

Undocumented PQdisplayTuples and PQprintTuples in libpq

From
Michael Paquier
Date:
Hi all,

I have noticed today that the two functions in $subject are part of
libpq and remain around undocumented since they are around (see
6ef5846 and 2b84cbb).  Isn't it past time to get rid of them?  We have
PQprint as well, which was used in the past by psql but not today,
still that's documented.  Note that the coverage in this area is a
perfect 0%:
https://coverage.postgresql.org/src/interfaces/libpq/fe-print.c.gcov.html

I am also wondering how an update to exports.txt should be handled in
this case.  Just by commenting out the numbers which are not used
anymore?

Thanks,
--
Michael

Attachment

Re: Undocumented PQdisplayTuples and PQprintTuples in libpq

From
Fabien COELHO
Date:
Bonjour Michaël,

> I have noticed today that the two functions in $subject are part of
> libpq and remain around undocumented since they are around (see
> 6ef5846 and 2b84cbb).  Isn't it past time to get rid of them?  We have
> PQprint as well, which was used in the past by psql but not today,
> still that's documented.  Note that the coverage in this area is a
> perfect 0%:
> https://coverage.postgresql.org/src/interfaces/libpq/fe-print.c.gcov.html

<sigh>

> I am also wondering how an update to exports.txt should be handled in
> this case.  Just by commenting out the numbers which are not used
> anymore?

How do you know that they are not used by anyone in the wild?
If they are broken, it would be a clue. If not, possibly someone somewhere 
could be using it, eg for debug (what does this result look like?).

-- 
Fabien.

Re: Undocumented PQdisplayTuples and PQprintTuples in libpq

From
Michael Paquier
Date:
On Mon, Aug 05, 2019 at 06:54:32AM +0200, Fabien COELHO wrote:
> How do you know that they are not used by anyone in the wild?
> If they are broken, it would be a clue. If not, possibly someone somewhere
> could be using it, eg for debug (what does this result look like?).

They have been around for more than 19 years, and they have been
undocumented for this much amount of time.  github does not report any
reference to any of them.  Of course I cannot say that nobody has code
using them, but the odds that this number is close to zero are really
high, and that they ought to use something a bit newer if need be.
--
Michael

Attachment

Re: Undocumented PQdisplayTuples and PQprintTuples in libpq

From
Tom Lane
Date:
Michael Paquier <michael@paquier.xyz> writes:
> On Mon, Aug 05, 2019 at 06:54:32AM +0200, Fabien COELHO wrote:
>> How do you know that they are not used by anyone in the wild?
>> If they are broken, it would be a clue. If not, possibly someone somewhere
>> could be using it, eg for debug (what does this result look like?).

> They have been around for more than 19 years, and they have been
> undocumented for this much amount of time.  github does not report any
> reference to any of them.  Of course I cannot say that nobody has code
> using them, but the odds that this number is close to zero are really
> high, and that they ought to use something a bit newer if need be.

I'm afraid that we will get pushback from vendors who say that removing an
exported function is an ABI break.  At minimum, certain people will insist
that this requires an increment in the shlib major version for libpq.so.
And that will cause a lot of pain, because it'd mean that v13 libpq.so
is no longer usable by applications built against older releases.

On the whole, I think benign neglect is the best policy here.

            regards, tom lane