Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dktb9-0002Ck-9p for pgsql-general@arkaria.postgresql.org; Thu, 24 Aug 2017 14:59:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dktb8-00075z-RQ for pgsql-general@arkaria.postgresql.org; Thu, 24 Aug 2017 14:59:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dktYj-0002pQ-UV for pgsql-general@postgresql.org; Thu, 24 Aug 2017 14:56:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dktYh-0007QH-Er for pgsql-general@postgresql.org; Thu, 24 Aug 2017 14:56:36 +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 v7OEuXg9014979; Thu, 24 Aug 2017 10:56:33 -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> Comments: In-reply-to Igor Korot message dated "Thu, 24 Aug 2017 09:47:42 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14977.1503586593.1@sss.pgh.pa.us> Date: Thu, 24 Aug 2017 10:56:33 -0400 Message-ID: <14978.1503586593@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: > On Thu, Aug 24, 2017 at 8:51 AM, Tom Lane wrote: >> I think what we need is to (1) introduce some error checking in libpq so >> that it reports an error if the resultset exceeds 2G rows --- right now >> it'll just crash, I fear, and (2) change the documentation so that this >> is explained as a library-wide limitation and not just a problem with >> PQntuples. > Does this mean that querying a table with a big number of rows will > crash the psql? I haven't tried it, but it sure looks like it would, if you don't hit OOM first. pqAddTuple() isn't doing anything to guard against integer overflow. The lack of reports implies that no one has ever tried to retrieve even 1G rows, let alone more ... 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