Re: Startup messages for socket protocol - Mailing list pgsql-general

From Guillaume Yziquel
Subject Re: Startup messages for socket protocol
Date
Msg-id 20110317152308.GZ22969@localhost
Whole thread Raw
In response to Re: Startup messages for socket protocol  (Guillaume Yziquel <guillaume.yziquel@citycable.ch>)
List pgsql-general
Le Thursday 17 Mar 2011 à 16:08:55 (+0100), Guillaume Yziquel a écrit :
> Le Thursday 17 Mar 2011 à 10:48:50 (-0400), Tom Lane a écrit :
> > Guillaume Yziquel <guillaume.yziquel@citycable.ch> writes:
>
> For now, when sending \000\003\000\000 and only this, the server seems
> to disconnect. The recv() call on the socket returns 0, which should
> mean that the server has dropped the connection.

Got it:

Sent: "\000\000\000\022\000\003\000\000user\000yziquel\000\000"
Read from socket:
"R\000\000\000\b\000\000\000\000S\000\000\000\025client_encoding\000UTF8\000S\000\000\000\023DateStyle\000ISO,

DMY\000S\000\000\000\025integer_datetimes\000on\000S\000\000\000\027IntervalStyle\000postgres\000S\000\000\000\021is_superuser\000off\000S\000\000\000\025server_encoding\000UTF8\000S\000\000\000\025server_version\0008.4.7\000S\000\000\000\"session_authorization\000yziquel\000S\000\000\000$standard_conforming_strings\000off\000S\000\000\000\023TimeZone\000localtime\000K\000\000\000\012\000\000|\197{\177\235?Z\000\000\000\005I"

Needed to prepend the length of the packet.

Didn't appear very clearly in the docs. But this link got me more info:

http://blog.endpoint.com/2010/05/finding-postgresql-version-without.html

Thanks for your time.

--
     Guillaume Yziquel

pgsql-general by date:

Previous
From: "tamanna madaan"
Date:
Subject: Re: query stuck at SOCK_wait_for_ready function call
Next
From: Scott Ribe
Date:
Subject: Re: Primary key vs unique index