Re: Terms.

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Terms.
Дата
Msg-id AANLkTin2wu81c_TfQijqU=CGH=fFF+1g-LF=ArQopCsy@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Terms.  (Dmitriy Igrishin <dmitigr@gmail.com>)
Ответы Re: Terms.  (Dmitriy Igrishin <dmitigr@gmail.com>)
Re: Terms.  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-docs
On Fri, Sep 17, 2010 at 3:03 PM, Dmitriy Igrishin <dmitigr@gmail.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

В списке pgsql-docs по дате отправления:

Предыдущее
От: Dmitriy Igrishin
Дата:
Сообщение: Re: Terms.
Следующее
От: Dmitriy Igrishin
Дата:
Сообщение: Re: Terms.