Reputation: 1417
I'm upgrading Postgres from ancient 7.4 to 9.4.1 and seeing some errors.
On the old machine, I did:
pg_dumpall | gzip > db_pg_bu.gz
On the new machine, I did:
gunzip -c db_pg_bu.gz | psql
While restoring I got a number of errors which I don't understand, and don't know the importance of. I'm not a DBA, just a lowly developer, so if someone could help me understand what I need to do to get this migration done I would appreciate it.
Here are the errors:
ERROR: cannot delete from view "pg_shadow"
DETAIL: Views that do not select from a single table or view are not automatically updatable.
HINT: To enable deleting from the view, provide an INSTEAD OF DELETE trigger or an unconditional ON DELETE DO INSTEAD rule.
I also got about 15 of these:
NOTICE: SYSID can no longer be specified
And this, although this looks harmless since I saw plpgsql is installed by default stating in version 9.2:
ERROR: could not access file "/usr/lib/postgresql/lib/plpgsql.so": No such file or directory
SET
NOTICE: using pg_pltemplate information instead of CREATE LANGUAGE parameters
ERROR: language "plpgsql" already exists
A big concern is that, as it restores the databases, for each ne I see something like this:
COMMENT
You are now connected to database "landrush" as user "postgres".
SET
ERROR: could not access file "/usr/lib/postgresql/lib/plpgsql.so": No such file or directory
Upvotes: 0
Views: 408
Reputation: 44250
There are basically two ways. Both are difficult for the inexperienced. (and maybe even for the experienced)
psql < dumpfile
, like in the question). A possible path first hop could be 7.4 -> 8.3, but maybe an additional hop might be needed.BTW: it is advisable to use the pg_dump from the newer version(the one that you will import to). You'll need to specify the source host via the -h flag. The new (target) version knows about what the new version needs, and will try to adapt (upto a certain point, you still need to use more than one step) I will also refuse to work if it cannot produce a usable dump. (In which case you'll have to make smaller steps...)
Extra:
NOTICE: using pg_pltemplate information instead of CREATE LANGUAGE parameters
I don't know what this is. Maybe the way that additional languages, such as plpgsql, were added to the core dbms.ERROR: language "plpgsql" already exists
: You can probably ignore this error. -->> comment out the offending lines.DETAIL: Views that do not select from a single table or view are not automatically updatable.
This implies that the postgres RULE rewrite system is used in the old DB. It will need serious work to get it working again.Upvotes: 1