Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] Frontend/Backend Protocol

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jdale(at)fla(dot)fujitsu(dot)com
Cc: pgsql-hackers(at)postgreSQL(dot)org, pgsql-ports(at)postgreSQL(dot)org, pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Frontend/Backend Protocol
Date: 1999-07-23 00:30:31
Message-ID: 11030.932689831@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfacespgsql-ports
Jonathan Dale <jdale(at)fla(dot)fujitsu(dot)com> writes:
> And I get back:
> "R" 00 00 00 00  which indicates a successful connection

Looks good so far (I suppose you are using 'trust' authentication mode).

> However, when my process has read this, the postmaster displays the
> following error:

> FATAL 1:  Socket command type   unknown

> and the connection is closed.

No, the postmaster didn't send that; the backend did.  Looks like you
sent one byte too many, probably a null byte, and the backend received
it as the first input data byte.  Since it's not a valid protocol
command character, the backend gives up and dies.

> I assumed that the
> postmaster would fork a new postgres process to handle my connection

... it did ...

> and I should be expecting some data on the socket to tell me that the
> postgres process is ready for an SQL query.

You should have gotten a ReadyForQuery message if you are talking to
a 6.4 or later backend, and if you used the right protocol version
number in the connect request.  I speculate that you have an old server,
or you asked for protocol version 1, or you miscounted bytes and missed
the appearance of the ReadyForQuery ('Z') message.

			regards, tom lane

pgsql-ports by date

Next:From: Uncle GeorgeDate: 1999-07-23 01:52:19
Subject: Re: [PORTS] RedHat6.0 & Alpha
Previous:From: Hub.Org News AdminDate: 1999-07-22 21:19:27
Subject:

pgsql-hackers by date

Next:From: Tom LaneDate: 1999-07-23 00:34:43
Subject: Re: [HACKERS] Maximum query string length
Previous:From: Hub.Org News AdminDate: 1999-07-22 21:19:25
Subject:

pgsql-interfaces by date

Next:From: Tom LaneDate: 1999-07-23 00:54:05
Subject: Re: [INTERFACES] SPI_exec vs. CREATE/DROP RULE
Previous:From: Stephen Martin Trans-Euro I.T LtdDate: 1999-07-23 00:14:22
Subject: libpq and VB

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group