Re: Implementation of the frontend protocol

From: jazz(at)kom(dot)auc(dot)dk (Lars Chr(dot) Hausmann)
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Korsgaard <jacmet(at)control(dot)auc(dot)dk>, pgsql-general(at)postgresql(dot)org
Subject: Re: Implementation of the frontend protocol
Date: 2000-11-14 19:29:09
Message-ID: 2har94emjy2.fsf@blackrussian.nork.auc.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

Tom> Peter Korsgaard <jacmet(at)control(dot)auc(dot)dk> writes:
>> I'm developing a SQL proxy and I would like to implement the server
>> protocol used by Postgres, so the proxy may act like a PostgreSQL server
>> towards the clients.

>> I have read the nice and clean documentation of the protocol on
>> http://www.postgresql.org/docs/programmer/protocol.htm, but instead of
>> reimplementating the protocol I would like to reuse the current
>> implementation.

Tom> I think you'd be better off coding from scratch. The backend is built
Tom> on the model that it's in control and it can send off messages or bits
Tom> of messages whenever it feels like. It's going to be very difficult to
Tom> adapt that code to a multi-client proxy server, even assuming you could
Tom> easily extract just the code that does communication --- but the forest
Tom> is rather thickly clustered around those trees ;-)

>> As far as I can tell from the protocol specification and the description
>> of how PostgreSQL processes a query (src/tools/backend/index.html) it is
>> implemented in or around src/backend/postmaster/postmaster.c and
>> src/backend/tcop/postgres.c - but I still have a bit of problems finding
>> my way around the sourcecode.

Tom> postmaster.c and postgres.c are the outer loops, but they don't actually
Tom> do much of the message-slinging. The low-level I/O code is in
Tom> backend/libpq. The rest of the message processing is, um, hither and
Tom> yon.

As a related note (I'm working with Peter on this thing) we asked the
MySQL guys about this. It seems they have all ready prepared MySQL for
distribution in that they have implemented a structure like "LOAD
TABLE FROM MASTER" which would then sync the table from a master to a
slave. Has PostgreSQL anything similar, or do we have to do it
ourselv? (I think, any help is appriciated, since we are seriously
running out of time ,-)).

Regards,

Lars Chr. Hausmann

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2000-11-14 19:55:43 Re: Implementation of the frontend protocol
Previous Message Mário Jorge Nunes Filipe 2000-11-14 18:28:44 Migrating some data