pg_restore and schema's

Started by Dick Kniepover 20 years ago3 messagesgeneral
Jump to latest
#1Dick Kniep
dick@kniep.nl

Hi list,

We have developed an application that makes extensive use of schema's in the
database. Some of the schemanames are uppercase, some are lowercase.

I make a backup using

pg_dump -f /tmp/dumpdb -F c -Z 5 cvix

When I try to restore this file, it fails with

postgres@linux:/tmp> pg_restore -O -d cvix2 /tmp/dumpdb
pg_restore: [archiver (db)] could not execute query: ERROR: schema "Lindix"
does not exist

What am I doing wrong, or is it a bug. After the restore the database does
contain the schema's but all in lowercase.

Hope someone knows what to do!

Cheers,
Dick Kniep

#2Michael Fuhr
mike@fuhr.org
In reply to: Dick Kniep (#1)
Re: pg_restore and schema's

On Mon, Aug 22, 2005 at 09:30:36AM +0200, Dick Kniep wrote:

postgres@linux:/tmp> pg_restore -O -d cvix2 /tmp/dumpdb
pg_restore: [archiver (db)] could not execute query: ERROR: schema "Lindix"
does not exist

What version of PostgreSQL are you using? I can duplicate this
problem with 7.4.8, but only with pg_restore's -O option. If
I turn on statement logging, I see the following when running
pg_restore -O:

CREATE SCHEMA Test;

If I run pg_restore without -O, I see the following:

CREATE SCHEMA "Test" AUTHORIZATION postgres;

Since identifiers must be quoted to preserve case, I'd say the -O
behavior is a bug. You might wish to report this to pgsql-bugs.

I tested 8.0.3 and it doesn't have this problem.

--
Michael Fuhr

#3Dick Kniep
dick@kniep.nl
In reply to: Michael Fuhr (#2)
Re: pg_restore and schema's

Hi Michael,

Yes indeed, it is 7.4.8, and I will file a bugreport.

Op maandag 22 augustus 2005 15:21, schreef Michael Fuhr:

Show quoted text

On Mon, Aug 22, 2005 at 09:30:36AM +0200, Dick Kniep wrote:

postgres@linux:/tmp> pg_restore -O -d cvix2 /tmp/dumpdb
pg_restore: [archiver (db)] could not execute query: ERROR: schema
"Lindix" does not exist

What version of PostgreSQL are you using? I can duplicate this
problem with 7.4.8, but only with pg_restore's -O option. If
I turn on statement logging, I see the following when running
pg_restore -O:

CREATE SCHEMA Test;

If I run pg_restore without -O, I see the following:

CREATE SCHEMA "Test" AUTHORIZATION postgres;

Since identifiers must be quoted to preserve case, I'd say the -O
behavior is a bug. You might wish to report this to pgsql-bugs.

I tested 8.0.3 and it doesn't have this problem.