Re: Startup messages for socket protocol

From: Guillaume Yziquel <guillaume(dot)yziquel(at)citycable(dot)ch>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Startup messages for socket protocol
Date: 2011-03-17 15:23:08
Message-ID: 20110317152308.GZ22969@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)yziquel(at)citycable(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2011-03-17 16:13:19 Re: Primary key vs unique index
Previous Message Gauthier, Dave 2011-03-17 15:10:16 Re: Getting users/privs for tables.