Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UhM90-00073r-Vf for pgsql-admin@arkaria.postgresql.org; Tue, 28 May 2013 15:49:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UhM90-00005o-2B for pgsql-admin@arkaria.postgresql.org; Tue, 28 May 2013 15:49:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UhM8z-00005g-2i for pgsql-admin@postgresql.org; Tue, 28 May 2013 15:49:01 +0000 Received: from proofpoint1.mail.rice.edu ([128.42.201.100] helo=pp1.rice.edu) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UhM8n-0006pp-6L for pgsql-admin@postgresql.org; Tue, 28 May 2013 15:49:00 +0000 Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id r4S60CMR011738; Tue, 28 May 2013 10:48:38 -0500 Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by pp1.rice.edu with ESMTP id 1c3847vc17-1; Tue, 28 May 2013 10:48:38 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.rice.edu (aart.rice.edu [168.7.56.48]) by mh2.mail.rice.edu (Postfix) with ESMTP id 088175000E5; Tue, 28 May 2013 10:48:38 -0500 (CDT) Received: by aart.rice.edu (Postfix, from userid 18612) id F35E51006A5; Tue, 28 May 2013 10:48:37 -0500 (CDT) Date: Tue, 28 May 2013 10:48:37 -0500 From: "ktm@rice.edu" To: Steve.Toutant@inspq.qc.ca Cc: pgsql-admin@postgresql.org Subject: Re: exceeded MAX_ALLOCATED_DESCS while trying to open file Message-ID: <20130528154837.GQ12507@aart.rice.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-Pg-Spam-Score: -3.0 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On Tue, May 28, 2013 at 11:28:02AM -0400, Steve.Toutant@inspq.qc.ca wrote: > Hi, > Using postgres 9.2, I created a FOREIGN TABLE on a csv file. It works. > But I need to change the structure of the data and I created several sql > select using union, like > select .... from .foreign table... where... > union > select .... from .foreign table... where... > union > ... > It works for the first 10 select but then I get > ERROR: exceeded MAX_ALLOCATED_DESCS while trying to open file > "/srv/www/data/antidote/registre.csv" > > What is it MAX_ALLOCATED_DESCS? and how can I modify it without changing > the code and re-compile? I tried using postgref.conf but this parameters > is not recognize. > thanks > steve Hi Steve, Each SELECT opens your FOREIGN TABLE so you are opening it 10 times. This is hardcoded by a #define in ./src/backend/storage/file/fd.c during the build so you would need to recompile the software yourself to change it. Can you re- write your query using a single SELECT or possibly read the data into a temporary table for processing? Regards, Ken -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin