Re: real/float example for testlibpq3

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mark Wong <markwkm(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Chapman Flack <chap(at)anastigmatix(dot)net>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: real/float example for testlibpq3
Date: 2023-01-20 18:12:07
Message-ID: CA+Tgmoa-t8u0DVbJ5e2JEcrUuTJm0WhZm=6U0tVDkjYH9y1JMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 20, 2023 at 12:58 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I don't mind if you write something like
>
> A float4 value is a 4-byte IEEE single-precision floating point
> number. It is transmitted in network byte order, so you must
> convert to local byte order. (C users can do this portably
> using the standard ntohl() function.)
>
> but I'm not sure an example is worth more than such a parenthetical
> comment. Perhaps others disagree, though.

I don't disagree with that.

I do think that when you suggested documenting this rather than just
adding some examples, you moved the goalposts a long way. If we're
going to add this to the documentation, it probably ought to cover
every data type we ship. Overall, I think that would be a better
result than just adding a few examples for the most common data types
to testlibpq*.c, but it's also substantially more work. I do agree
with you that if we're going to document this, as opposed to provide
examples, then a narrative style is more appropriate than a whole
bunch of small sample programs; maintaining working code in the
documentation seems like an annoying amount of maintenance and is
probably not the most efficient way to communicate useful information.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-01-20 18:19:47 Re: run pgindent on a regular basis / scripted manner
Previous Message Nathan Bossart 2023-01-20 18:10:38 Re: almost-super-user problems that we haven't fixed yet