Submitted by firstname.lastname@example.org on Mon, 11/28/2011 - 10:54
Is there anyway to configure the backup script to skip dropping and creating a language for a backed up database? If we don't manually edit the postgresql backup file we end up with this error:
pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 520; 2612 61755 PROCEDURAL LANGUAGE plpgsql pgsql pg_restore: [archiver (db)] could not execute query: ERROR: language "plpgsql" already exists Command was: CREATE PROCEDURAL LANGUAGE plpgsql;
Submitted by JamieCameron on Mon, 11/28/2011 - 14:47 Comment #1
Are you creating this backup using Virtualmin's domain-level backup, or Webmin's PostgreSQL module?
Submitted by JamieCameron on Mon, 11/28/2011 - 14:47 Comment #2
Also, which PostgreSQL version is your system running?
Submitted by email@example.com on Mon, 01/23/2012 - 15:06 Comment #3
We're using Virtualmin's domain-level backup, PostgreSQL 9.1.2
Submitted by JamieCameron on Mon, 01/23/2012 - 16:23 Comment #4
I did some research on this, and it seems that if your
template1database already has that language, it can cause this error - see https://www.servoy.com/forum/viewtopic.php?f=4&t=12451
The fix may be to delete the
plpgsqllanguage from the
template1database. I am guessing it doesn't exist by default..
I could fix Virtualmin to ignore these errors during a restore, but only at the cost of having it ignore all errors.
Submitted by firstname.lastname@example.org on Fri, 01/27/2012 - 15:47 Comment #5
What we did was drop the plpgsql language from the template db. In the future is there anyway you can expose the -e (ignore errors) pg_restore option in the restore script?
Submitted by JamieCameron on Fri, 01/27/2012 - 15:59 Comment #6
Cool, that sounds like the best solution.
The trouble with the
-eflag is that it ignores all errors, even those that you might really need to know about, like errors writing to the database.