Re: BUG #12832: pg_dump ERROR with temporary functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: marko(at)joh(dot)to
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12832: pg_dump ERROR with temporary functions
Date: 2015-03-05 14:50:28
Message-ID: 22146.1425567028@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

marko(at)joh(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message eshkinkot 2015-03-05 16:37:08 BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed
Previous Message Elena Fernandez Carmona 2015-03-05 10:27:10 compatibilty postgres 9.2 RHEL 6.4