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 1iCJjz-0002jZ-I5 for pgsql-admin@arkaria.postgresql.org; Mon, 23 Sep 2019 08:30:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iCJjy-0002hH-B2 for pgsql-admin@arkaria.postgresql.org; Mon, 23 Sep 2019 08:30:38 +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 1iCJjx-0002hA-UB for pgsql-admin@lists.postgresql.org; Mon, 23 Sep 2019 08:30:38 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iCJjt-0000Vb-Oj for pgsql-admin@lists.postgresql.org; Mon, 23 Sep 2019 08:30:37 +0000 Received: by mail-wr1-x42d.google.com with SMTP id h7so12852084wrw.8 for ; Mon, 23 Sep 2019 01:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zunibal-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=1frmdW9ny82gfPIVIzlNTw7sAlCgpUFltNQLq5Piblg=; b=l9zdvffinX5xOzpqpCnxv/hTP7ANCy+lW+aKa7fIz3eOYvRJggGywghnklu23qOYhx 6fMwhvyoBGmXY8lLA8xM9D3ekLj7QsKYD8y8Zey5XsSsqjqLbTWTtjopaMMpiYRqSpnI 7XSTg+ved6RAs3nKD+z/4WoQaCBlgBlXVTC3icab86T/VcqVPfksVWSBkwTZXXZQPmXf KpvHXwPsVGv1+aJKb38nBaDKdA0Ts8xD/JqQ4OdPuwz1rgc7gk2Qt0594yaSl4PVB+d4 EbpLyHlLRKcwyuKd9MQld6WPLMM1N46kTgUX26F1Jz58QL2Cmmi42z5uYkvrZyNy1yNm yVYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=1frmdW9ny82gfPIVIzlNTw7sAlCgpUFltNQLq5Piblg=; b=fNhmStRpsWECsFp4gNRwkabjfctscMrQhp237lVbxA//DRY7igKl8Ogrz4LqKUaHlb u6JMZ9JzDTwReaPGgbOwHUXvY3AmNvQUdixDYSh5prwFhmPa29hZyYu4p2Dwz4yrK9JM JsNyvlgt47jCf0VAVdlUCWUFC3DMMOHmYyRkhV009uBhPlhk/OrQ+chuFo5iQr8G94xi gIupyycUAvsXI/KxgojNF0pIYKBwf/bwyC1t7Utqrj+9HllnGdVPNWKF9ZRVijItuznn bCA6yR6ivGm5WK5MpD6oSnOB5GzsJXsLfIN2nJOrc7rAodeKpx1zO5kwdaVU+kEJ34bf JqEQ== X-Gm-Message-State: APjAAAWqyn6VPmzJjy9nsZy9A3VP9qC1kWRQ3JW/3pLkqjJ6GPf/S7Kk 338/NA+UORJ1AM+2ZoPu6jpLUOPJRTA= X-Google-Smtp-Source: APXvYqwsZCO/KrFmDXOSHLt8stZ5hsm9uBtwv8JkZhxtKrYoe6/Elmzn8dq+IPIEB6FWYampjEw5SQ== X-Received: by 2002:a5d:684a:: with SMTP id o10mr19307490wrw.23.1569227429011; Mon, 23 Sep 2019 01:30:29 -0700 (PDT) Received: from [192.168.3.150] ([176.222.91.85]) by smtp.gmail.com with ESMTPSA id f197sm11460071wme.22.2019.09.23.01.30.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Sep 2019 01:30:28 -0700 (PDT) Subject: Re: Pg_upgrade error could not load library from 7.14/8.4 to 10.10 version To: pgsql-admin@lists.postgresql.org References: <4519fdad-d747-cd39-f6a2-33e7db1f3324@matrix.gatewaynet.com> <22046.1568901429@sss.pgh.pa.us> <13f3ecf4-248e-eb80-3906-fd2defe8a443@matrix.gatewaynet.com> <575b4ec4-020e-e750-d622-dfa5ad2cc078@matrix.gatewaynet.com> From: Ekaterina Amez Message-ID: Date: Mon, 23 Sep 2019 10:30:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <575b4ec4-020e-e750-d622-dfa5ad2cc078@matrix.gatewaynet.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk My apologies, I think I still don't have enough coffee in my body. I've made my tests right, with drop function, but used a script and named it drop language. This made me mess up things in my head and my last email. No more questions about this. Thanks for your patience. El 23/9/19 a las 10:18, Achilleas Mantzios escribió: > Dear Ekaterina, > > On 23/9/19 10:45 π.μ., Ekaterina Amez wrote: >> Hi Achilleas, >> >> El 20/9/19 a las 11:41, Achilleas Mantzios escribió: >>> On 20/9/19 12:22 μ.μ., Ekaterina Amez wrote: >>>> Hi Achilleas, >>>> >>>> After restoring backup in v8.4: >>>> >>>> newdb=# select proname,probin,pronamespace from pg_proc where >>>> proname='plpgsql_call_handler'; >>>>        proname        |                 probin | pronamespace >>>> ----------------------+----------------------------------------+-------------- >>>> >>>>  plpgsql_call_handler | $libdir/plpgsql |           11 >>>>  plpgsql_call_handler | /usr/lib/postgresql/8.4/lib/plpgsql.so >>>> |         2200 >>>> (2 filas) >>>> >>>> As you said, 2200 is public namespace/schema and 11 is pg_catalog. >>>> >>>> >>>> At the beginning of the backup file I can find these sentences: >>>> >>>> CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler >>>>     LANGUAGE c >>>>     AS '/usr/lib/postgresql/8.4/lib/plpgsql.so', >>>> 'plpgsql_call_handler'; <-- I've changed this line to use the right >>>> path to plpgsql.so library >>>> >>>> CREATE PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler; >>>> >>>> I guess these are the ones causing all of this. **What should be >>>> the best way to handle this situation?** Remove these lines and >>>> create the language explicitly when creating database? >>> >>> Just drop the 2nd function (in the public schema) : >>> drop function public.plpgsql_call_handler ( ) ; >>> and see pg_upgrade goes from there. >>> >>>> Or replace them with a create language sentence? Maybe something >>>> else? My final goal is migrate from 7.14 server to 8.4 server and >>>> after that (if I have an OK from the boss) upgrade 8.4 to the >>>> latest version that I can use. Server uses CentOS, and probably I >>>> won't be able to upgrade to v10 but I hope at least 9.5/9.6 will be >>>> available. >>> >> >> I've tested your suggestion and it went OK: restored db in 8.4, run >> "drop language" sentence, stopped services and run pg_upgrade > I wrote "drop function" not language. >> --check which ended up with "Clusters are compatible". GREAT!! But... >> >> In one of my tests I forgot to change the path to plpgsql.so library, >> and when restoring db it gave me an error saying it could not > Drop the wrong extra function, and then you don't have to change the > path. The correct function (in pg_catalog) will be correct. >> access to the path given (of course, because that path only exists in >> the server, in my machine is different). After restoring with this >> error I found that: >> >> newdb=# select fn_now(); >>      fn_now >> ---------------- >>  20190923085521 >> (1 fila) >> >> newdb=# select proname,probin,pronamespace from pg_proc where >> proname='plpgsql_call_handler'; >>        proname        |     probin      | pronamespace >> ----------------------+-----------------+-------------- >>  plpgsql_call_handler | $libdir/plpgsql |           11 >> (1 fila) >> >> Which means that despite the error, language has been created. So in >> the end, not creating plpgsql_call_handler function and running "drop >> language" both leads me to the same result. I understood this piece >> of code [1] like: "create this language called plpgsql that will be >> interpreted by this function called plpgsql_call_handler wich code is >> in the library plpgsql.so". But with these results don't know the >> meaning of this code, as one of the solutions is drop language after >> creating, and the other one is create language without it's handler. >> I would appreciate an explanation about this, why is this happening >> or what am I misunderstanding. >> >> [1] this piece of code: >> CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler >>     LANGUAGE c >>     AS '/usr/lib/pgsql/plpgsql.so', 'plpgsql_call_handler'; >> >> CREATE PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler; > You're kinda messing up FUNCTION with LANGUAGE. Read the docs, and if > you find any questions then go ahead and ask again. > Please try to just DROP the extra public.plpgsql_call_handler (not the > language) and try again. >> >> >> > >