Wire protocol docs

Started by Dave Pageover 16 years ago7 messages
#1Dave Page
dpage@pgadmin.org

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

#2Abhijit Menon-Sen
ams@toroid.org
In reply to: Dave Page (#1)
Re: Wire protocol docs

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

#3Dave Page
dpage@pgadmin.org
In reply to: Abhijit Menon-Sen (#2)
Re: Wire protocol docs

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

#4Greg Smith
gsmith@gregsmith.com
In reply to: Dave Page (#1)
Re: Wire protocol docs

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

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dave Page (#3)
Re: Wire protocol docs

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

#6Dave Page
dpage@pgadmin.org
In reply to: Tom Lane (#5)
Re: Wire protocol docs

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

#7Bruce Momjian
bruce@momjian.us
In reply to: Dave Page (#6)
Re: Wire protocol docs

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.com
  PG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do
  + If your life is a hard drive, Christ can be your backup. +