Thread: Need for protocol description

Need for protocol description

From
"Dinesh Parikh"
Date:
Hi All
I want protocol descriptions of Postgresql 7.1 I mean how Postgres listens request at default port 5432. If one wants to write to execute some query using its program(like in C, java) directry by sending data at server socket 5432 then how this task can be achieved. Can anybody tell me from where i can find this.
 
Thanks
Regards
Dinesh Parikh

Re: Need for protocol description

From
Martijn van Oosterhout
Date:
On Thu, Oct 18, 2001 at 06:02:43PM +0530, Dinesh Parikh wrote:
> Hi All

> I want protocol descriptions of Postgresql 7.1 I mean how Postgres listens
> request at default port 5432. If one wants to write to execute some query
> using its program(like in C, java) directry by sending data at server
> socket 5432 then how this task can be achieved. Can anybody tell me from
> where i can find this.

I suggest you use libpq (C), libpq++ (C++), Pg.pm (Perl), etc... There are
already interface libraries for this already. Use one of those.

If you really want to do it, I don't know if there is an actual description
but there is always the source.
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.

Re: Need for protocol description

From
Einar Karttunen
Date:
On Thu, Oct 18, 2001 at 06:02:43PM +0530, Dinesh Parikh wrote:
> Hi All
> I want protocol descriptions of Postgresql 7.1 I mean how Postgres listens
> request at default port 5432. If one wants to write to execute some query
> using its program(like in C, java) directry by sending data at server socket
> 5432 then how this task can be achieved. Can anybody tell me from where i
> can find this.
>
This will be probably be a very bad idea... One should use the libraries.
The way I would go about this would be reading the source code of one of the
libraries. I think libpq source is quite clear and has lots of comments.

- Einar Karttunen

Re: Need for protocol description

From
Doug McNaught
Date:
"Dinesh Parikh" <dineshp@newgen.co.in> writes:

> I want protocol descriptions of Postgresql 7.1 I mean how Postgres
> listens request at default port 5432. If one wants to write to
> execute some query using its program(like in C, java) directry by
> sending data at server socket 5432 then how this task can be
> achieved. Can anybody tell me from where i can find this.

Have you tried the docs?  There is a protocol description in there.

Also look at the source code for the various client interfaces (libpq,
the JDBC driver, etc).

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863