Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dl1Op-0001i2-6p for pgsql-general@arkaria.postgresql.org; Thu, 24 Aug 2017 23:18:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dl1Oo-0002aL-O6 for pgsql-general@arkaria.postgresql.org; Thu, 24 Aug 2017 23:18:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dl1On-0002Yk-9e for pgsql-general@postgresql.org; Thu, 24 Aug 2017 23:18:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dl1Ok-0002zF-8M for pgsql-general@postgresql.org; Thu, 24 Aug 2017 23:18:52 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v7ONIlCN017617; Thu, 24 Aug 2017 19:18:47 -0400 From: Tom Lane To: Igor Korot cc: Michael Paquier , pgsql-general Subject: Re: Retrieving query results In-reply-to: References: <32584.1503579096@sss.pgh.pa.us> <14978.1503586593@sss.pgh.pa.us> Comments: In-reply-to Igor Korot message dated "Thu, 24 Aug 2017 19:05:22 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17615.1503616727.1@sss.pgh.pa.us> Date: Thu, 24 Aug 2017 19:18:47 -0400 Message-ID: <17616.1503616727@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Igor Korot writes: > So there is no way to retrieve an arbitrary number of rows from the query? > That sucks... The restriction is on the number of rows in one PGresult, not the total size of the query result. You could use single-row mode, or use a cursor and fetch some reasonable number of rows at a time. If you try to inhale all of a many-gigarow result at once, you're going to have OOM problems anyway, even if you had the patience to wait for it. So I don't think the existence of a limit is a problem. Failure to check it *is* a problem, certainly. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general