Received: from kodu.home.ee (sl-2.uninet.ee [194.204.0.34]) by hub.org (8.9.2/8.9.1) with ESMTP id QAA72639 for ; Mon, 8 Feb 1999 16:22:19 -0500 (EST) (envelope-from hannu@trust.ee) Received: from trust.ee (hannu@localhost [127.0.0.1]) by kodu.home.ee (8.8.7/8.8.7) with ESMTP id XAA00692; Mon, 8 Feb 1999 23:25:32 +0200 Sender: hannu@kodu.home.ee Message-ID: <36BF564C.D1A9F8FA@trust.ee> Date: Mon, 08 Feb 1999 23:25:32 +0200 From: Hannu Krosing Organization: Trust-O-Matic =?iso-8859-1?Q?O=DC?= X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.2.1 i686) X-Accept-Language: en MIME-Version: 1.0 To: Matthew Hagerty CC: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] Dealing with large query results References: <4.1.19990208145905.00a0b8d0@mail.venux.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Matthew Hagerty wrote: > > Greetings, > > I keep seeing reference to an 8K limit on query results. So how to deal > with query results greater than 8K? Am I under the wrong impression that > when you run a query from, say libpq, that each retch row is returned only > when you execute a fetchrow? Or is the whole query stuffed in to a buffer > which has an 8K limit? the current 8K limit is for queries (and unrelatedly single rows), not query _results_ > I have to deal with some queries that create a huge result, and/or doing > reports requires a large result set. How can I deal with these larger results? If you dont want to digest a huge result, you can do a DECLARE CURSOR - FETCH -FETCH - FETCH - CLOSE CURSOR thing to get it in pieces (needs to be inside BEGIN TRANSACTION - END TRANSACTION) > I'll probably get flamed for asking this one but, how can I step through a > table? Hey, sometimes you just have to do it. See above. Actually postgres is quite happy to return gigabytes of data, if you have the resources (disk space, memory, time ;) -------------- Hannu