X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 8F7D4D1B562 for ; Thu, 2 Oct 2003 09:12:34 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 48087-07 for ; Thu, 2 Oct 2003 06:11:49 -0300 (ADT) Received: from sd.tpf.co.jp (unknown [210.161.239.34]) by svr1.postgresql.org (Postfix) with SMTP id A47EFD1B552 for ; Thu, 2 Oct 2003 06:11:45 -0300 (ADT) Received: (qmail 19476 invoked from network); 2 Oct 2003 18:11:35 +0900 Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108) by sd2.tpf-fw-c.co.jp with SMTP; 2 Oct 2003 18:11:35 +0900 Received: from tpf.co.jp ([126.0.1.67]) by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id SAA16872; Thu, 2 Oct 2003 18:11:33 +0900 (JST) Message-ID: <3F7BEC15.D2F9962D@tpf.co.jp> Date: Thu, 02 Oct 2003 18:12:53 +0900 From: Hiroshi Inoue X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U) X-Accept-Language: ja MIME-Version: 1.0 To: Mike Mascari Cc: Ben Trewern , pgsql-odbc@postgresql.org Subject: Re: FUD!! ODBC will not be supported by Microsoft in the future References: <3F7B0321.9010202@mascari.com> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=EMAIL_ATTRIBUTION, QUOTED_EMAIL_TEXT, RCVD_IN_OSIRUSOFT_COM, REFERENCES, REPLY_WITH_QUOTES, USER_AGENT_MOZILLA_XM X-Spam-Level: X-Archive-Number: 200310/17 X-Sequence-Number: 3330 Currently we can only use forward-only read-only cursors with 'Use Declare/Fetch' option. BDE may need scrollable (and holdable ?) cursors so as to use the ODBC driver effectively though I'm not sure. Non read-only applications have had some troubles with 'Use Declare/Fetch' option, because PostgreSQL's cursors could not live across transactions. In 7.4 we would have holdable cursors which could live outside transactions, so we would be able to implement the option properly for 7.4 servers. I'm planning to implement static read-only cursors with 'Use Desclre/Fetch' option. regards, Hiroshi Inoue http://www.geocities.jp/inocchichichi/psqlodbc/ Mike Mascari wrote: > > Ben Trewern wrote: > > > I've been using (or trying to use) the pgODBC driver with 'Use > > Declare/Fetch' set to true and all goes well till you try to go to > > the end of a large recordset. The driver seems to load all the > > records instead of just the last 50 (or whatever). I'm using Delphi > > 7, BDE and psqlODBC version 7.03.01.08 to connect to Postgres 7.3.1. > > > > Any ideas? Could this be a BDE problem? Any one else out there > > using this configuration? > > and > > > If you look in the pg 7.3 docs it seems to state that FETCH can fetch > > backwards. Does this mean that the backend needs to materialize the > > whole recordset but could return just the last n records to the client? > > If so then that would be different than the current psqlODBC state of > > affairs and would be a net gain as it would reduce network traffic. > > > > Any thoughts? > > > > Ben > > Well, looking at the ODBC sources shows that it is capable of using > DECLARE/FETCH to move to the end the record set. PostgreSQL will still > have to materialize the result set on the backend, of course. So I'd > suggest performing an ODBC trace to see which ODBC API functions are > being called on the client side and also turn logging on in > postgresql.conf to see what the queries look like on the server. > > ODBC provides access to cursor operations through the use of > SQLFetch(), which is a forward-only cursor and SQLFetchScroll() which > is scroll-capable. Perhaps Delphi 7 is using SQLFetch() instead of > SQLFetchScroll()? The ODBC trace will tell. > > Mike Mascari > mascarm@mascari.com