Обсуждение: pg_dump / pg_upgrade problem

Поиск
Список
Период
Сортировка

pg_dump / pg_upgrade problem

От
Simone Tellini
Дата:
Hi,

if you have a database whose name has capital letters (eg. TestMe), you
won't be able to restore it from a dump nor use pg_upgrade as the dump
will try to /connect TestMe, which will give the error "database testme
doesn't exists"

--

Simone Tellini
E-mail: tellini@areabusiness.it
http://www.areabusiness.it


Re: pg_dump / pg_upgrade problem

От
Simone Tellini
Дата:
On Sat, 09 Feb 2002 22:56:16 +0100
Simone Tellini <tellini@areabusiness.it> wrote:

ST> won't be able to restore it from a dump nor use pg_upgrade as the dump
ST> will try to /connect TestMe, which will give the error "database testme
ST> doesn't exists"

I've forgot: the same applies to mixed case usernames.

--

Simone Tellini
E-mail: tellini@areabusiness.it
http://www.areabusiness.it


Re: pg_dump / pg_upgrade problem

От
Simone Tellini
Дата:
On Sat, 09 Feb 2002 23:23:20 +0100
Simone Tellini <tellini@areabusiness.it> wrote:

ST> ST> will try to /connect TestMe, which will give the error "database testme
ST> ST> doesn't exists"
ST> I've forgot: the same applies to mixed case usernames.

...ok, mixed case username will make it a PITA to restore the db, as the
problem isn't only in the connect line (which I've just tried to fix
manually with quotes)   <sigh>

--

Simone Tellini
E-mail: tellini@areabusiness.it
http://www.areabusiness.it


Re: pg_dump / pg_upgrade problem

От
Naomi Walker
Дата:
My guess is that this will not be hard to fix.  What did you have to
change, exactly, to make it work?  I've got a mixed case dbname.

At 11:33 PM 2/9/02 +0100, Simone Tellini wrote:

>On Sat, 09 Feb 2002 23:23:20 +0100
>Simone Tellini <tellini@areabusiness.it> wrote:
>
>ST> ST> will try to /connect TestMe, which will give the error "database
>testme
>ST> ST> doesn't exists"
>ST> I've forgot: the same applies to mixed case usernames.
>
>...ok, mixed case username will make it a PITA to restore the db, as the
>problem isn't only in the connect line (which I've just tried to fix
>manually with quotes)   <sigh>
>
>--
>
>Simone Tellini
>E-mail: tellini@areabusiness.it
>http://www.areabusiness.it
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


Re: pg_dump / pg_upgrade problem

От
Simone Tellini
Дата:
On Sun, 10 Feb 2002 10:49:29 -0700
Naomi Walker <nwalker@eldocomp.com> wrote:

NW> My guess is that this will not be hard to fix.  What did you have to
NW> change, exactly, to make it work?  I've got a mixed case dbname.

for database names you just need to find the '\connect dbname user' line
and turn it into '\connect "dbname" user'

For usernames it isn't so simple, as it'll fail later on (when assigning
table owners and stuff, I guess).

The simplest way to restore a db with mixed case usernames is to
change the CREATE USER commands at the top of the dump to lowercase,
restore it and then rename the users (if it's possible).

--

Simone Tellini
E-mail: tellini@areabusiness.it
http://www.areabusiness.it


Re: pg_dump / pg_upgrade problem

От
Stephan Szabo
Дата:
On Sun, 10 Feb 2002, Simone Tellini wrote:

>
> On Sun, 10 Feb 2002 10:49:29 -0700
> Naomi Walker <nwalker@eldocomp.com> wrote:
>
> NW> My guess is that this will not be hard to fix.  What did you have to
> NW> change, exactly, to make it work?  I've got a mixed case dbname.
>
> for database names you just need to find the '\connect dbname user' line
> and turn it into '\connect "dbname" user'
>
> For usernames it isn't so simple, as it'll fail later on (when assigning
> table owners and stuff, I guess).

Do you know what lines it's failing on in the dump specifically (for
purposes of fixing it)?


Re: pg_dump / pg_upgrade problem

От
Simone Tellini
Дата:
On Sun, 10 Feb 2002 10:39:08 -0800 (PST)
Stephan Szabo <sszabo@megazone23.bigpanda.com> wrote:

SS> Do you know what lines it's failing on in the dump specifically (for
SS> purposes of fixing it)?

I think everywhere it uses the username. From the dump:

\connect WizNet WizNet      (both are wrong)
--
-- Selected TOC Entries:
--
\connect - WizNet        (hm... I think I missed this when quoting
                                 manually, perhaps it would have been
                                 enough then)
[...]
-- Name: users Type: TABLE Owner: WizNet
(is this a comment or is it used for something?)

--

Simone Tellini
E-mail: tellini@areabusiness.it
http://www.areabusiness.it


Re: pg_dump / pg_upgrade problem

От
Stephan Szabo
Дата:
On Sun, 10 Feb 2002, Simone Tellini wrote:

>
> On Sun, 10 Feb 2002 10:39:08 -0800 (PST)
> Stephan Szabo <sszabo@megazone23.bigpanda.com> wrote:
>
> SS> Do you know what lines it's failing on in the dump specifically (for
> SS> purposes of fixing it)?
>
> I think everywhere it uses the username. From the dump:
>
> \connect WizNet WizNet      (both are wrong)
> --
> -- Selected TOC Entries:
> --
> \connect - WizNet        (hm... I think I missed this when quoting
>                                  manually, perhaps it would have been
>                                  enough then)

Probably would be sufficient to do that, yes.

> [...]
> -- Name: users Type: TABLE Owner: WizNet
> (is this a comment or is it used for something?)

AFAIK, just a comment.