Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id E83681B25E4D for ; Thu, 15 Mar 2012 19:09:04 -0300 (ADT) Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S8Ir2-0000Yj-1T for pgsql-bugs@postgresql.org; Thu, 15 Mar 2012 22:09:04 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1S8Iqo-0001B9-P1; Thu, 15 Mar 2012 18:08:50 -0400 Date: Thu, 15 Mar 2012 18:08:50 -0400 From: Bruce Momjian To: stuart@stuartbishop.net Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6532: pg_upgrade fails on Python stored procedures Message-ID: <20120315220850.GA20113@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/116 X-Sequence-Number: 32677 On Thu, Mar 15, 2012 at 01:13:29PM +0000, stuart@stuartbishop.net wrote: > The following bug has been logged on the website: > > Bug reference: 6532 > Logged by: Stuart Bishop > Email address: stuart@stuartbishop.net > PostgreSQL version: 9.1.3 > Operating system: Ubuntu > Description: > > The 9.1.3 changelog states pg_upgrade's handing of plpython stored > procedures was fixed, but that does not appear to be the case: The change in 9.1.3 was to allow the pg_upgrade code which checks if all the shared librarires are in place to see plpython.so as equivalent to plpython2.so. I did not modify pg_dump at all, which is where you are seeing the error. > There were problems executing "/usr/lib/postgresql/9.1/bin/psql" --set > ON_ERROR_STOP=on --no-psqlrc --port 5435 --username "postgres" -f > "/var/lib/postgresql/pg_upgrade_dump_db.sql" --dbname template1 >> > "/dev/null" > Failure, exiting > > > The relevant section of pg_upgrade_dump_db.sql is: > > CREATE FUNCTION plpython_call_handler() RETURNS language_handler > LANGUAGE c > AS '$libdir/plpython', 'plpython_call_handler'; OK, I am pretty confused by this. Here is all I get in the pg_dumpall --binary-upgrade output for plpython when I create one plpython function: -- -- Name: plpythonu; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres -- CREATE OR REPLACE PROCEDURAL LANGUAGE plpythonu; ALTER PROCEDURAL LANGUAGE plpythonu OWNER TO postgres; SET search_path = public, pg_catalog; -- -- Name: pymax(integer, integer); Type: FUNCTION; Schema: public; Owner: postgres -- CREATE FUNCTION pymax(a integer, b integer) RETURNS integer LANGUAGE plpythonu AS $$ if a > b: return a return b $$; ALTER FUNCTION public.pymax(a integer, b integer) OWNER TO postgres; I have repeatedly upgraded from 9.0.X to 9.1.3 and am seeing no failures. The big question is what are you doing that is causing the plpython_call_handler() function to be dumped? That is an internal function. What is your old PG version? I tested 8.4 and also could not get the failure you see either. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +