Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 509E711DF226 for ; Thu, 31 May 2012 15:53:56 -0300 (ADT) Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SaAVP-0004LH-Dq for pgsql-bugs@postgresql.org; Thu, 31 May 2012 18:53:56 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1SaAVC-0003Fq-Ms; Thu, 31 May 2012 14:53:42 -0400 Date: Thu, 31 May 2012 14:53:42 -0400 From: Bruce Momjian To: Adrian Klaver Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6666: pg_upgrade 9.2beta1 plpython/plpython2 Message-ID: <20120531185342.GJ26894@momjian.us> References: <20120530023416.GQ20260@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120530023416.GQ20260@momjian.us> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/239 X-Sequence-Number: 33210 On Tue, May 29, 2012 at 10:34:16PM -0400, Bruce Momjian wrote: > My point is that plpython_call_handler is defined in the public and > pg_catalog schema, as are other language handlers. > > In fact, an argument could be made that the bug is really in pg_dump. > When we moved the language handlers into pg_catalog, I don't think any > effort was made to suppress the public schema handlers from being dumped. > Maybe that's where the fix should be. It would allow us to fix all the > languages, not just plpython when using pg_upgrade. I think the big > question is can we uniquely identify them. > > I did see this C comment in pg_dump.c: > > /* > * Determine whether we want to dump definitions for procedural languages. > * Since the languages themselves don't have schemas, we can't rely on > * the normal schema-based selection mechanism. We choose to dump them > * whenever neither --schema nor --table was given. (Before 8.1, we used > * the dump flag of the PL's call handler function, but in 8.1 this will > * probably always be false since call handlers are created in pg_catalog.) > * > * For some backwards compatibility with the older behavior, we forcibly > * dump a PL if its handler function (and validator if any) are in a > * dumpable namespace. That case is not checked here. > * > * Also, if the PL belongs to an extension, we do not use this heuristic. > * That case isn't checked here either. > */ > static bool > shouldDumpProcLangs(void) OK, so what do people want me to do on this? Apply my pg_upgrade fix or go for a more general fix that will prevent pg_dump from dumping out these duplicate functions --- it would involve checking for public schema functions who's names and probin match pg_pltemplate entries. Either will fix pg_upgrade. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +