Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAww0-00071W-Ve for pgsql-admin@arkaria.postgresql.org; Thu, 19 Sep 2019 13:57:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iAwvy-0002lX-VR for pgsql-admin@arkaria.postgresql.org; Thu, 19 Sep 2019 13:57:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAwvy-0002lF-LX for pgsql-admin@lists.postgresql.org; Thu, 19 Sep 2019 13:57:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAwvr-0001Gz-P4 for pgsql-admin@lists.postgresql.org; Thu, 19 Sep 2019 13:57:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x8JDv9hv022047; Thu, 19 Sep 2019 09:57:09 -0400 From: Tom Lane To: Ekaterina Amez cc: pgsql-admin@lists.postgresql.org Subject: Re: Pg_upgrade error could not load library from 7.14/8.4 to 10.10 version In-reply-to: References: <4519fdad-d747-cd39-f6a2-33e7db1f3324@matrix.gatewaynet.com> Comments: In-reply-to Ekaterina Amez message dated "Thu, 19 Sep 2019 13:35:11 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <22045.1568901429.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 19 Sep 2019 09:57:09 -0400 Message-ID: <22046.1568901429@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ekaterina Amez writes: > El 19/9/19 a las 10:07, Achilleas Mantzios escribi=C3=B3: >> On 19/9/19 10:49 =CF=80.=CE=BC., Ekaterina Amez wrote: >>> 2019-09-19 08:53:50.345 CEST [2283] postgres@template1 ERROR: could n= ot load library "/usr/lib/postgresql/8.4/lib/plpgsql.so": /usr/lib/postgre= sql/8.4/lib/plpgsql.so: undefined symbol: SPI_push This error is clearly due to trying to load the 8.4 version of plpgsql.so into the v10 server. What seems like the likely cause is that the pg_proc.probin entries for the plpgsql support functions were literally "/usr/lib/postgresql/8.4/lib/plpgsql.so", rather than something that would adapt to the new version. The preferred way to declare such functions, for a long time, has been with probin =3D "$libdir/plpgsql", relying on the server to subsitute an appropriate path for $libdir. > With these results, finally I've: > =C2=A0=C2=A0=C2=A0 1- modified template1 in PG 8.4 server to include pl= pgsql language, = > so it can be inherited in new databases created from this template. > =C2=A0=C2=A0=C2=A0 2- Dropped and recreated my database (let's call it = newdb). This probably fixed it by ensuring that the plpgsql support functions were declared with the standard value of probin. > The conclusion is that I can avoid the use of plpgsql.so library. My = > question now would be related about the creation of the language in = > version 8.4: is it better to create it at template level or at database = > level? I would not sweat too much about this, since you don't intend to keep using 8.4 (or at least I hope not). Since 9.0, plpgsql is automatically installed at initdb time and there's no need for an additional copy. regards, tom lane