Re: Terms.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: Terms.
Date: 2010-09-19 02:23:06
Message-ID: AANLkTin2wu81c_TfQijqU=CGH=fFF+1g-LF=ArQopCsy@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Fri, Sep 17, 2010 at 3:03 PM, Dmitriy Igrishin <dmitigr(at)gmail(dot)com> wrote:
> I am the reader and just a user of libpq, not a guru :-).
> I must admit that this is a trifle, but I think it's indeed inaccurate.
> Also I think, that it's inaccurate to call one function PQnfields()
> and another PQftablecol(). Yes, terms "field" and "column" are
> interchangeable, but (personally) I don't  clearly understand why two
> functions named not monotonous.

Yeah, the libpq functions have awfully strange names, and I don't even
think you've picked the strangest example. For example, PQftype
returns the type OID, and PQfmod returns the type modifier. Why not
PQftypemodifier or PQftypemod? Unfortunately, we're kind of stuck
with those names at this point, since changing them would break
backward compatibility. I suppose we could add more reasonably named
synonyms and encourage people to use those instead of the old ones,
but I think we'd still end up having to keep the old ones around
approximately forever.

With respect to PQnfields() vs. PQftablecol(), I think the word
"fields" is being used to refer to the columns of the result set, and
the word "columns" to refer to the columns of tables on the server.
So PQftablecol() is actually trying to tell you the number of the
table column where a particular "field" in the results came from.
This is sort of a subtle distinction, though, and the fact that
"field" is being abbreviated to "f" in some but not all cases doesn't
make it any more clear. PQftablecol() is really supposed to mean
"field-table-column" - i.e. look up the table column for this field.
But the name is definitely less than totally self-documenting.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

  • Re: Terms. at 2010-09-17 19:03:22 from Dmitriy Igrishin

Responses

  • Re: Terms. at 2010-09-19 10:32:05 from Dmitriy Igrishin
  • Re: Terms. at 2010-09-20 15:29:21 from Bruce Momjian

Browse pgsql-docs by date

  From Date Subject
Next Message Dmitriy Igrishin 2010-09-19 10:32:05 Re: Terms.
Previous Message Dmitriy Igrishin 2010-09-17 19:03:22 Re: Terms.