Thanks for the quick response.
For new I cannot do changes in old version DB, since it is deployed remotely and i dont have any access. And it has to be done from multiple servers.
As a work around I tried two solutions.
After downloading and extracting the dump, convert the pgdump file to sql file which is editable.
pg_restore -f out_dump.sql dump.pgdump
Replace all the plpythonu references with plputhon3u.
Restore using the sql file.
sudo -H -u postgres psql -p 5433 -d db_name < out_dump.sql
Solution 2:
After downloading and extracting the dump, get the list of items in dump (Schemas, tables, table data, Index, functions, etc).
pg_restore -l dump.pgdump > dump.txt
Delete all the function references which have plpython3u.
Create a sql file which has functions with plpython3u extensions.
Load the sql file to db
sudo -H -u postgres psql -p 5433 -d db_name < func.sql
Now restore the dump with only the items in the edited dump.txt file (Functions with plpython3u extensions removed).
sudo -H -u postgres pg_restore -p 5433 -j 8 --disable-triggers --no-privileges -L dump.txt -d db_name dump.pgdump
Question:
Our database size is 500GB,
Do we see any performance impact using solution 1. Since solution 1 is using sql file load and solution 2 is using pg_restore directly.
Kindly recommend what to choose, solution 1 or solution 2 or any other workaround to restore.
Thanks,
Samson G