Re: Backend Protocol

From: Barry Lind <barry(at)xythos(dot)com>
To: dave(at)fastcrypt(dot)com
Cc: "'PostgreSQL-development'" <pgsql-jdbc(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Backend Protocol
Date: 2001-11-06 03:11:38
Message-ID: 3BE754EA.7080704@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers pgsql-jdbc

Dave,

This is documented in the Developer's Guide (Chapter 4 Frontend/Backend
Protocol of the 7.1 docs).

A few days ago I added this same item the the jdbc todo list. I don't
think the implementation will need to do anything different at the FE/BE
protocol level. Instead my thoughts on this are to wrap all jdbc
Statements/Prepared Statements doing selects in a sql cursor, and then
issuing fetch statements to set sets of rows instead of the entire
result set.

Thus 'select foo from bar'

Whould get executed by the driver as:

declare barcursor cursor as select foo from bar;

followed by:

fetch forward 10 from barcursor;

(to select the first 10 rows)

additional fetches as needed...

finally:

close barcursor;

Just when this should be done (i.e. you probably don't want to overhead
of using a cursor for every select statement), how many rows to fetch at
a time (perhaps you might want to fetch 100 rows per call to minimize
network roundtrips) would need to be configurable somehow.

Also not the the jdbc2 spec has methods for setCursorName(), etc. and
just how they would play into this I don't know.

thanks,
--Barry

Dave Cramer wrote:

> Hi,
>
> I am looking at changing the jdbc driver to be asynchronous, in other
> words retrieve the result set when asked as opposed to retrieving it all
> before returning.
>
> This will involve understanding the client/backend protocol completely.
> So far I have found one reference to this. Does anyone have a flow chart
> or can point me to any other references.
>
> Dave
>
>

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message thomas 2001-11-06 16:27:32 pgsql/src/include/utils cash.h
Previous Message tgl 2001-11-06 01:15:29 pgsql/src/backend/utils/misc ps_status.c

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Harvey 2001-11-06 03:47:45 Re: compiler warnings in ODBC
Previous Message Vince Vielhaber 2001-11-06 03:03:45 Re: Beta going well

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2001-11-06 04:54:37 Re:
Previous Message Barry Lind 2001-11-06 02:58:04 Re: Encoding weirdness with JDBC, driver crashing?