X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ED92CD1B53E for ; Wed, 28 Jul 2004 06:46:21 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64107-02 for ; Wed, 28 Jul 2004 09:45:59 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 586AAD1B341 for ; Wed, 28 Jul 2004 06:45:54 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1Bpkzm-0000Dd-00; Wed, 28 Jul 2004 21:45:10 +1200 Message-ID: <4107759E.3080509@opencloud.com> Date: Wed, 28 Jul 2004 21:45:02 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Guido Fiala Cc: pgsql-jdbc@postgresql.org Subject: Re: fetchsize dynamically changeable? References: <200407280839.56336.guido.fiala@dka-gmbh.de> In-Reply-To: <200407280839.56336.guido.fiala@dka-gmbh.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/312 X-Sequence-Number: 10696 Guido Fiala wrote: > BTW - how is FETCH BACKWARD, what needs to be done to get it working? Briefly.. - design a scrollable cursor interface (extensions to QueryExecutor and perhaps ResultHandler, ResultCursor) - implement scrollable buffering logic in our ResultSet implementations (can probably take code from the earlier unapplied scrollable-cursor-resultset patch) - implement protocol-specific scrollable cursor logic . for the V3 path, this needs the DECLARE+parameters patch I have pending applied on the server side. . there is code in CVS history for analyzing statements and transforming to DECLARE/FETCH where appropriate I'm not sure what the split in the buffering logic between protocol-specific code and abstract resultset code should be. One approach is to just extend the QUERY_FORWARD_CURSOR style interface to allow fetching at arbitary absolute locations when QUERY_SCROLLABLE_CURSOR was specified originally. This is probably simpler. Another approach is to abstract the storage of result data and have the high-level code say "give me row number N" and the protocol implementation deals with buffering and cursor movement implicitly. This is architecturally nicer, and will better handle things like support for binary-format resultsets, or even the SPI interface that Thomas mentioned recently. But it'll be more work. Also, this needs to be done keeping support for WITH HOLD cursors in mind. Once the DECLARE/FETCH rewriting code is present, WITH HOLD should be easy to add.. None of this has been started on, AFAIK. -O