Re: pg_restore problem - Mailing list pgsql-novice

From Jules Alberts
Subject Re: pg_restore problem
Date
Msg-id 200208150914.g7F9DxuL028305@artemis.cuci.nl
Whole thread Raw
In response to Re: pg_restore problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_restore problem
List pgsql-novice
On 14 Aug 2002 at 11:13, Tom Lane wrote:
> "Jules Alberts" <jules.alberts@arbodienst-limburg.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.

pgsql-novice by date:

Previous
From: "Andy Pearce"
Date:
Subject: Trigger Function
Next
From: sol
Date:
Subject: FATAL 1:Sorry, too many clients