From: Tom Lane <tgl@sss.pgh.pa.us>
To: marko@joh.to
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #12832: pg_dump ERROR with temporary functions
Date: Thu, 05 Mar 2015 09:50:28 -0500
Message-ID: <22146.1425567028@sss.pgh.pa.us> (raw)
In-Reply-To: <20150305100343.2527.9521@wrigleys.postgresql.org>
References: <20150305100343.2527.9521@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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 ..; <run a
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, marko@joh.to
Subject: Re: BUG #12832: pg_dump ERROR with temporary functions
In-Reply-To: <22146.1425567028@sss.pgh.pa.us>
References: <20150305100343.2527.9521@wrigleys.postgresql.org> <22146.1425567028@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox