Обсуждение: Wire protocol docs

Поиск
Список
Период
Сортировка

Wire protocol docs

От
Dave Page
Дата:
On http://www.postgresql.org/docs/8.4/interactive/protocol.html we say:

"Higher level features built on this protocol (for example, how libpq
passes certain environment variables when the connection is
established) are covered elsewhere."

I cannot find anything that is obviously 'elsewhere' in the docs -
does that need fixing, or do my searching skills need improving?

*starts reading source code* :-)

-- 
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com


Re: Wire protocol docs

От
Abhijit Menon-Sen
Дата:
At 2009-10-13 17:25:15 +0100, dpage@pgadmin.org wrote:
>
> I cannot find anything that is obviously 'elsewhere' in the docs -
> does that need fixing, or do my searching skills need improving?

I don't know, but…

> *starts reading source code* :-)

Look at what fe-protocol3.c:build_startup_packet() does with its options
argument (and see fe-connect.c:EnvironmentOptions to see what is passed
to it). Basically, libpq sets some connection parameters to values taken
from the environment (e.g. client_encoding from PGCLIENTENCODING). What
the documentation you quoted is saying is that the wire protocol doesn't
know or care where the values came from.

-- ams


Re: Wire protocol docs

От
Dave Page
Дата:
On Tue, Oct 13, 2009 at 5:41 PM, Abhijit Menon-Sen <ams@toroid.org> wrote:
> At 2009-10-13 17:25:15 +0100, dpage@pgadmin.org wrote:
>>
>> I cannot find anything that is obviously 'elsewhere' in the docs -
>> does that need fixing, or do my searching skills need improving?
>
> I don't know, but…
>
>> *starts reading source code* :-)
>
> Look at what fe-protocol3.c:build_startup_packet() does with its options
> argument (and see fe-connect.c:EnvironmentOptions to see what is passed
> to it). Basically, libpq sets some connection parameters to values taken
> from the environment (e.g. client_encoding from PGCLIENTENCODING).

Yeah, grep found that pretty quickly :-)

> What
> the documentation you quoted is saying is that the wire protocol doesn't
> know or care where the values came from.

Right. My complaint though, is that the docs imply that the info on
how those values get set is in the docs somewhere, which appears to be
incorrect.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com


Re: Wire protocol docs

От
Greg Smith
Дата:
On Tue, 13 Oct 2009, Dave Page wrote:

> On http://www.postgresql.org/docs/8.4/interactive/protocol.html we say:
>
> "Higher level features built on this protocol (for example, how libpq
> passes certain environment variables when the connection is
> established) are covered elsewhere."

http://www.postgresql.org/docs/8.4/static/libpq-envars.html and 
http://www.postgresql.org/docs/8.4/static/libpq-connect.html are what I 
think it's alluding to here.

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD


Re: Wire protocol docs

От
Tom Lane
Дата:
Dave Page <dpage@pgadmin.org> writes:
> Right. My complaint though, is that the docs imply that the info on
> how those values get set is in the docs somewhere, which appears to be
> incorrect.

The libpq documentation does cover the fact that libpq uses those
variables to establish initial settings.  I wouldn't expect it to
go into implementation details, would you?
        regards, tom lane


Re: Wire protocol docs

От
Dave Page
Дата:
On Tue, Oct 13, 2009 at 6:24 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Dave Page <dpage@pgadmin.org> writes:
>> Right. My complaint though, is that the docs imply that the info on
>> how those values get set is in the docs somewhere, which appears to be
>> incorrect.
>
> The libpq documentation does cover the fact that libpq uses those
> variables to establish initial settings.  I wouldn't expect it to
> go into implementation details, would you?

Not the libpq docs, no. I was expecting something to though, having
been told in the intro to the low level protocol details that:

"Higher level features built on this protocol (for example, how libpq
passes certain environment variables when the connection is
established) are covered elsewhere."

Note that it says *how* libpq passes those variables which implies the
mechanism of passing them to the server. Anyway, I can figure out what
I need from the existing code - I just found that sentence misleading
and think it should probably be removed.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com


Re: Wire protocol docs

От
Bruce Momjian
Дата:
Dave Page wrote:
> On Tue, Oct 13, 2009 at 6:24 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Dave Page <dpage@pgadmin.org> writes:
> >> Right. My complaint though, is that the docs imply that the info on
> >> how those values get set is in the docs somewhere, which appears to be
> >> incorrect.
> >
> > The libpq documentation does cover the fact that libpq uses those
> > variables to establish initial settings. ?I wouldn't expect it to
> > go into implementation details, would you?
> 
> Not the libpq docs, no. I was expecting something to though, having
> been told in the intro to the low level protocol details that:
> 
> "Higher level features built on this protocol (for example, how libpq
> passes certain environment variables when the connection is
> established) are covered elsewhere."
> 
> Note that it says *how* libpq passes those variables which implies the
> mechanism of passing them to the server. Anyway, I can figure out what
> I need from the existing code - I just found that sentence misleading
> and think it should probably be removed.

Agreed, removed.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.comPG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do + If your life is a hard
drive,Christ can be your backup. +