Re: Issue with Restore dump with plpythonu, plpython3u installed on postgres16

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Sam Son <sam89(dot)g(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Issue with Restore dump with plpythonu, plpython3u installed on postgres16
Date: 2024-09-03 15:16:43
Message-ID: 23e8a33e-19af-4a33-b0fa-a225052c264d@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Muhammad Usman Khan 2024-09-03 16:25:17 Re: Issue with Restore dump with plpythonu, plpython3u installed on postgres16
Previous Message Tom Lane 2024-09-03 14:53:43 Re: How to grant role to other user