Re: pg_restore problem

From: "Jules Alberts" <jules(dot)alberts(at)arbodienst-limburg(dot)nl>
To: pgsql-novice(at)postgresql(dot)org
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_restore problem
Date: 2002-08-15 09:13:22
Message-ID: 200208150914.g7F9DxuL028305@artemis.cuci.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 14 Aug 2002 at 11:13, Tom Lane wrote:
> "Jules Alberts" <jules(dot)alberts(at)arbodienst-limburg(dot)nl> writes:
> > BTW in between I do a dropdb mydb
>
> You probably defined plpgsql in template1, so that when you do "createdb
> mydb" there's already a plpgsql definition in mydb. This confuses
> pg_restore, which is expecting to restore into a virgin database. Try
> "createdb -T template0 mydb" to make a database with no local additions,
> and then restore into that.
>
> regards, tom lane

Thanks, that was it! I did a complete reinstall of 7.2.1 to make sure
everything is default again (it's a test environment).

Now I have another pg_restore problem. When I lo_import() an image I
get a OID, say 241803. An lo_export() works OK. Then I do a backup with

pg_dump --oids --blobs --format=c --compress=9 \
--verbose --file=mydb.dump mydb &> mydbBackup.log

then a dropdb mydb, then a restore with

pg_restore --dbname=mydb --verbose --format=c \
mydb.dump &> mydbRestore.log

This restores the OIDs of all my tables (as I expected), except the
BLOBs, lo_export(241803, '/tmp/foobar') says "ERROR inv_open large
object 241803 not found". This is a problem because I save the BLOBs
OID as a reference in other tables. Am I doing something wrong or is
this a known issue?

TIA!

--
Jules Alberts.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message sol 2002-08-15 11:45:31 FATAL 1:Sorry, too many clients
Previous Message Andy Pearce 2002-08-15 01:22:55 Trigger Function