Обсуждение: Bug #590: Migration to Postgres 7.2 impossible when capitals are used in database name

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

Bug #590: Migration to Postgres 7.2 impossible when capitals are used in database name

От
pgsql-bugs@postgresql.org
Дата:
Ruud van den Brink (ruud@stress.utwente.nl) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
Migration to Postgres 7.2 impossible when capitals are used in database name

Long Description
Hello,

I discovered a bug in the connect statements of postgresql 7.2. After a pg_dumpall in postgresql 7.1.3, upgrading to
Postgresql7.2 and an initdb, the following lines from the script, generated by pg_dumpall, cause a problem: 

---
\connect template1 postgres
CREATE DATABASE "iBBS-oud" WITH TEMPLATE = template0 ENCODING = 'SQL_ASCII'; \connect iBBS-oud postgres
---

The database replies with:

FATAL 1: Database "ibbs-oud" does not exist in the system catalog.

The reason is, that the database is called "iBBS-oud" and not "ibbs-oud". The script contains the correct name of the
database,but postgres seems to convert the capitals in "iBBS-oud" to lowercase so it becomes "ibbs-oud" internally. 

It is however possible to connect to this database by means of starting psql with "psql -U postgres iBBS-oud". Connect
statementsin postgres itself all fail. But it's impossible to convert a set of huge databases from postgresql 7.1.3 to
version7.2 

Kind regards and keep up the good work,

Ruud van den Brink.

Sample Code


No file was uploaded with this report

Re: Bug #590: Migration to Postgres 7.2 impossible when capitals are used in database name

От
Tom Lane
Дата:
pgsql-bugs@postgresql.org writes:
> The reason is, that the database is called "iBBS-oud" and not "ibbs-oud". The script contains the correct name of the
database,but postgres seems to convert the capitals in "iBBS-oud" to lowercase so it becomes "ibbs-oud" internally. 

Yes, pg_dump fails to quote the database name properly.  This is already
fixed for 7.2.1.  You may care to grab current sources (see the nightly
snapshot tarballs in the FTP dev/ directory) and use the latest pg_dump
to perform the dump from your 7.1.3 server.  Or just edit the connect
statements in the dump you have.

            regards, tom lane