Re: dump + restore didn't include schemas

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dan Langille" <dan(at)langille(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: dump + restore didn't include schemas
Date: 2004-01-31 16:56:00
Message-ID: 4638.1075568160@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Dan Langille" <dan(at)langille(dot)org> writes:
>>> I upgraded two servers today from 7.3.* to 7.4.1. In both cases, the
>>> schemas which existed in the original databases were not created in
>>> the new database.

> I found three of these messages in /var/log/messages on the box which
> had the problem.

> ERROR: permission denied for database pg_freebsddiary.org.schemas

Oh, I bet I know what this is: the owners of those schemas don't have
CREATE SCHEMA privileges, right? You made the schemas as superuser with
CREATE SCHEMA foo AUTHORIZATION bar.

7.4's pg_dump will use AUTHORIZATION so that situations like this
restore correctly, but 7.3's pg_dump is stupid and tries to create the
schema as its owner.

In general I recommend that during an upgrade, you use the new version's
pg_dump to dump from the old server. This way you get the benefit of
whatever improvements have been made in pg_dump since the previous
release.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dan Langille 2004-01-31 17:01:13 Re: dump + restore didn't include schemas
Previous Message Joe Conway 2004-01-31 16:52:42 Re: [PATCHES] v7.4.1 text_position() patch