Re: connecting to server process via sockets

From: Yanni Chiu <yanni(at)rogers(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: connecting to server process via sockets
Date: 2005-05-16 16:07:14
Message-ID: 4288C532.9E8E5BCF@rogers.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Randall Smith wrote:
>
> For fun and learning, I would like to connect to the Postgresql backend
> and issue queries using sockets. I'm using Python's socket module. I'm
> new to socket programming, but I'm experienced with Python and
> Postgresql.

Look in the postgres docs for the section on frontend/backend protocol.
The handshaking and format of the bytes that go across the socket
are explained in that doc. section.

You also might want to look at:

http://ca.geocities.com/zazu(at)rogers(dot)com/pgsqueak/

where there are links to a class diagram and state diagram
of an implementation done in Squeak Smalltalk. I don't know
Python, but IMHO the basic design should be transferable.

Note that frontend/backend protocol version 2 is implemented
in that code, and the current docs will reflect version 3
(so you'd have to look at the older docs to match up the code).

Hope that helps.
--yanni

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2005-05-16 17:42:27 Re: Named Notation for Functions' Parameteres
Previous Message Lada 'Ray' Lostak 2005-05-16 16:06:46 Re: Sequences question & problem