Re: Issue with Restore dump with plpythonu, plpython3u installed on postgres16 - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Issue with Restore dump with plpythonu, plpython3u installed on postgres16
Date
Msg-id f53c8d83-bf1b-4c04-a2ed-3ae5116aa582@aklaver.com
Whole thread Raw
In response to Re: Issue with Restore dump with plpythonu, plpython3u installed on postgres16  (Muhammad Usman Khan <usman.k@bitnine.net>)
Responses Re: Issue with Restore dump with plpythonu, plpython3u installed on postgres16
List pgsql-general
On 9/3/24 09:25, Muhammad Usman Khan wrote:
> Hi,
> You need to install plpython3u on your new server and also make sure to 
> use python3. You need to make changes to your functions also to make 
> them compatible with python3

That only works if the dump from the old server is outputting 
plpython3u. If the plpythonu is the only version installed on the old 
server then that is what will be in the dump file. As of Postgres 15 
plpythonu is no longer available:

https://www.postgresql.org/docs/15/plpython-python23.html

This means if you are moving to 15+ you can't have any references to 
plpythonu.

> 
> 
> On Tue, 3 Sept 2024 at 19:31, Sam Son <sam89.g@gmail.com 
> <mailto:sam89.g@gmail.com>> wrote:
> 
>     Hi Team,
> 
>     I am working on a project where we have applications run on old
>     versions of postgres, we are using *plpythonu* in all Functions
>     extension,
> 
>     Now we have upgraded postgres to latest which does not support
>     plpythonu anymore, So we are facing an issue while restoring dump
>     which has plpythonu, but latest postgres support only plpython3u.
> 
>     *"pg_restore: error: could not execute query: ERROR:  language
>     "plpythonu" does not exist"*
> 
>     How to change plpythonu to plpython3u in the dump file before
>     pg_restore. or Does postgres have any option to handle directly via
>     config.
> 
>     Thanks in Advance
> 
>     Thanks,
>     Samson G
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




pgsql-general by date:

Previous
From: David Mullineux
Date:
Subject: Re: Table and data comparison
Next
From: Adrian Klaver
Date:
Subject: Re: Issue with Restore dump with plpythonu, plpython3u installed on postgres16