Re: Postgre Protocol

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg <grigorey(at)yahoo(dot)co(dot)uk>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Postgre Protocol
Date: 2010-06-28 23:10:45
Message-ID: 5797.1277766645@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Greg <grigorey(at)yahoo(dot)co(dot)uk> writes:
> Hi Tom, thanks for the quick reply. I've looked at the break points and you are right there are 7 more bytes with data send with AuthenticationOk message, so I think thats what I need to look at :) (Im sure this is just a confirmation that everything is ok).
> May I ask, sequence of bytes after the AuthenticationOk messages is: 0080003; Is this sequence represent BackendKeyData or values for Authentication*** status codes, or Im completely worng and it is realy nothing but confirmation for a frontend how the database applied options passed with start-up packet?

That doesn't look right at all. Per the start-up portion of the Message
Flow section:

After having received AuthenticationOk, the frontend must wait for further messages from the server. In this phase a backend process is being started, and the frontend is just an interested bystander. It is still possible for the startup attempt to fail (ErrorResponse), but in the normal case the backend will send some ParameterStatus messages, BackendKeyData, and finally ReadyForQuery.

I'd expect ten or so ParameterStatus messages (depending on which PG
version you are working with), so there's easily going to be 100+ bytes
between the AuthenticationOk and ReadyForQuery messages. As I said
earlier, the backend will not flush this data out until it's ready for a
query, so you should expect to see it all arriving in one network
packet.

[ eyeballs that data some more... ] Are you *sure* you've collected an
AuthenticationOk message? The various authentication response messages
all have the same type code ('R'), and 0000000800000003 would be what
follows that for AuthenticationCleartextPassword. Maybe the backend is
really challenging you for a password. Have you checked what ought to
happen according to pg_hba.conf?

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message raghu ram 2010-06-29 07:48:34 Re: [NOVICE] Prepared statement issue in Pgpool-II
Previous Message raghu ram 2010-06-28 22:14:19 Prepared statement issue in Pgpool-II