Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTX6n-0006ss-LV for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Mar 2015 14:50:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YTX6n-00013w-5J for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Mar 2015 14:50:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YTX6m-00013q-HP for pgsql-bugs@postgresql.org; Thu, 05 Mar 2015 14:50:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YTX6e-0008Jy-Rs for pgsql-bugs@postgresql.org; Thu, 05 Mar 2015 14:50:39 +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 t25EoSb0022147; Thu, 5 Mar 2015 09:50:28 -0500 From: Tom Lane To: marko@joh.to cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12832: pg_dump ERROR with temporary functions In-reply-to: <20150305100343.2527.9521@wrigleys.postgresql.org> References: <20150305100343.2527.9521@wrigleys.postgresql.org> Comments: In-reply-to marko@joh.to message dated "Thu, 05 Mar 2015 10:03:43 +0000" Date: Thu, 05 Mar 2015 09:50:28 -0500 Message-ID: <22146.1425567028@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org marko@joh.to writes: > We've occasionally been having a problem where a script does roughly this: > psql -d dbname -c "CREATE TEMPORARY FUNCTION pg_temp.foo() AS ..; query using the temporary function a number of times>" > pg_dump -d dbname > And the pg_dump call ERRORs out like this: > pg_dump: [archiver (db)] query failed: ERROR: cache lookup failed for > function 2540046 > pg_dump: [archiver (db)] query was: SELECT tableoid, oid, proname, prolang, > pronargs, proargtypes, prorettype, proacl, pronamespace, > pg_catalog.pg_get_function_identity_arguments(oid) AS proiargs,(SELECT > rolname FROM pg_catalog.pg_roles WHERE oid = proowner) AS rolname FROM > pg_proc p WHERE NOT proisagg AND (pronamespace != (SELECT oid FROM > pg_namespace WHERE nspname = 'pg_catalog') > AND NOT EXISTS (SELECT 1 FROM pg_depend WHERE classid = > 'pg_proc'::regclass AND objid = p.oid AND deptype = 'i')) I think the core of the problem here is an ill-advised decision to use pg_get_function_identity_arguments() at all in the first query. The result is only used for sorting objects, and we could surely do that another way. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs