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 23e8a33e-19af-4a33-b0fa-a225052c264d@aklaver.com
Whole thread Raw
In response to Issue with Restore dump with plpythonu, plpython3u installed on postgres16  (Sam Son <sam89.g@gmail.com>)
List pgsql-general
On 9/2/24 04:37, Sam Son 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,

What versions of Postgres?

> 
> 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.

The best way I found to do this is install plpython3u in the old 
versions and convert your plpythonu functions to use plpython3u. Then 
you can drop plpythonu and do the dump/restore. This will also make you 
deal with the fact that Python2 != Python3 and your functions may need 
Python related changes as well.

> 
> *"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: Tom Lane
Date:
Subject: Re: How to grant role to other user
Next
From: Muhammad Usman Khan
Date:
Subject: Re: Issue with Restore dump with plpythonu, plpython3u installed on postgres16