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@rogers.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