Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 83FC1311511 for ; Wed, 14 Dec 2011 11:25:47 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RaqiF-0004BL-Fq for pgsql-performance@postgresql.org; Wed, 14 Dec 2011 15:25:47 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id pBEFPUgL007081; Wed, 14 Dec 2011 10:25:30 -0500 (EST) To: Jon Nelson cc: pgsql-performance@postgresql.org Subject: Re: copy vs. C function In-reply-to: References: <29057.1323843491@sss.pgh.pa.us> Comments: In-reply-to Jon Nelson message dated "Wed, 14 Dec 2011 08:06:09 -0600" Date: Wed, 14 Dec 2011 10:25:30 -0500 Message-ID: <7080.1323876330@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -4.4 (----) X-Archive-Number: 201112/114 X-Sequence-Number: 45913 Jon Nelson writes: > Regarding caching, I tried caching it across calls by making the > TupleDesc static and only initializing it once. > When I tried that, I got: > ERROR: number of columns (6769856) exceeds limit (1664) > I tried to find some documentation or examples that cache the > information, but couldn't find any. You might find reading record_in to be helpful. What it caches is not exactly what you need to, I think, but it shows the general principles. There are lots of other functions that use fn_extra to cache info, too. regards, tom lane