Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 1F412C2FBC7 for ; Sun, 27 May 2012 15:50:23 -0300 (ADT) Received: from mail-pz0-f46.google.com ([209.85.210.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SYiXj-0005At-Rl for pgsql-bugs@postgresql.org; Sun, 27 May 2012 18:50:22 +0000 Received: by dady13 with SMTP id y13so3268984dad.19 for ; Sun, 27 May 2012 11:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=e/uOt0LizpPAzC4r9nnlAo0CkoGJibdC203qq1MTA+A=; b=s6cKCs1DWzsasSx3tF0ls8J7pJY2tfN1jVuBPVmg5yxAexdOz1quOBTUQd/09R/d8q di/uU6W1iGMy7oimMovLkcHx9IaOI9q97cQHBVKcV9wh2+Ff6gaNEV1nE/giX8tHW29G KuNZCUV6UkV8sFsm/Qoa4DOpGm/oDSsq4PAsSAaVLo4SFR0+tguajj3ZdnHlXwad2XYl zjIPAGLMBKUWOGaahE2b7TJoRsTwXCdnvEU+j7VPFLveiUVcJ9qd/c6B5ztyW+QhKPaz dih/z89vcdQgYrsH3sj/J30gmWRJbBRaBqj7qVyOUjOMntx/HZsP7fkrbXrgHjq8wT+n cqlQ== Received: by 10.68.202.130 with SMTP id ki2mr19634998pbc.52.1338144605818; Sun, 27 May 2012 11:50:05 -0700 (PDT) Received: from [192.168.0.3] (c-24-17-164-54.hsd1.wa.comcast.net. [24.17.164.54]) by mx.google.com with ESMTPS id in7sm16574783pbc.23.2012.05.27.11.50.04 (version=SSLv3 cipher=OTHER); Sun, 27 May 2012 11:50:05 -0700 (PDT) Message-ID: <4FC2773B.6050206@gmail.com> Date: Sun, 27 May 2012 11:49:31 -0700 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Bruce Momjian CC: pgsql-bugs@postgresql.org Subject: Re: BUG #6666: pg_upgrade 9.2beta1 plpython/plpython2 References: <20120527022416.GA20260@momjian.us> In-Reply-To: <20120527022416.GA20260@momjian.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) X-Archive-Number: 201205/207 X-Sequence-Number: 33178 On 05/26/2012 07:24 PM, Bruce Momjian wrote: > On Sat, May 26, 2012 at 11:42:09PM +0000, adrian.klaver@gmail.com wrote: >> The following bug has been logged on the website: >> >> Bug reference: 6666 >> Logged by: Adrian Klaver >> Email address: adrian.klaver@gmail.com >> PostgreSQL version: 9.0.7 >> Operating system: Linux/OpenSuse 12.1 >> Description: >> >> >> I just tried an upgrade from 9.0.7 to 9.2beta1 using pg_upgrade. I ran it >> first with -c and everything passed. When I did a live upgrade it failed >> with this message in pg_upgrade_restore.log: >> >> CREATE FUNCTION plpython_call_handler() RETURNS language_handler >> LANGUAGE c >> AS '$libdir/plpython', 'plpython_call_handler'; >> psql:pg_upgrade_dump_db.sql:13541: ERROR: could not access file >> "$libdir/plpython": No such file or directory >> >> That is indeed true, there is no plpython, there is plpython2 instead. I >> created a symlink plpython --> plpython2 and the upgraded succeeded after a >> re-initdb of the new cluster. > > It took me a little while to remember the cause of this problem, but I > found it! > > http://archives.postgresql.org/pgsql-hackers/2012-03/msg01101.php > > This was reported in March, 2012 --- please read the entire thread. The > problem is that you have a plpython_call_handler defined in the "public" > schema, and it is being dumped out by pg_dumpall, rather than using a > generic CREATE LANGUAGE statement. Odds are this is left over from an > older version of Postgres. This particular database dates back to version 7.2, though plpythonu was not added until version 8.0.x using the following: CREATE PROCEDURAL LANGUAGE 'plpythonu' HANDLER plpython_call_handler; Until now my procedure has been to do dump/restore to move from one major version to another. > > If you can help me find out how these got defined this way, I might be > able to prevent this problem for the next person. > After reading the above thread here is what the queries mentioned return: production=# SELECT nspname,proname,probin FROM pg_proc,pg_namespace WHERE probin LIKE '%python%' and pg_proc.pronamespace=pg_namespace.oid; nspname | proname | probin ------------+-------------------------+------------------ pg_catalog | plpython_call_handler | $libdir/plpython pg_catalog | plpython_inline_handler | $libdir/plpython public | plpython_call_handler | $libdir/plpython (3 rows) production=# SELECT tableoid, oid, proname, prolang, pronargs, proargtypes, prorettype, proacl, pronamespace, (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')); tableoid | oid | proname | prolang | pronargs | proargtypes | prorettype | proacl | pronamespace | rolname ----------+-----+---------+---------+----------+-------------+------------+--------+--------------+--------- (0 rows) If you need any more information let me know. Thanks, -- Adrian Klaver adrian.klaver@gmail.com