Case sensitivity in psql/pg_dump

Started by Michal Schwarzalmost 24 years ago3 messagesbugs
Jump to latest
#1Michal Schwarz
misch@czechin.cz

Problem:
--------
pg_dump does not honour case-sensitivity in user names, which results to
failures when restoring database.

Environment:
------------
Version: PostgreSQL 7.2 on i686-pc-linux-gnu, compiled by GCC 2.95.2
System: Linux jtam.brno.czechin.cz 2.2.17-RAID #8 SMP Mon Oct 16 10:48:13
CEST 2000 i686 unknown

Exact steps to reproduce this bug:
----------------------------------
Run "psql template1"

template1=> CREATE USER "BLBEC" WITH CREATEDB;
CREATE USER
template1=> \c - "BLBEC"
You are now connected as new user BLBEC.
template1=> CREATE DATABASE blbectest;
CREATE DATABASE
template1=> \c blbectest "BLBEC"
You are now connected to database blbectest as user BLBEC.
template1=> CREATE TABLE test (a INT);
CREATE
template1=> \q

Then run "pg_dump blbectest". Result will contain command '\connect -
BLBEC', which is incorrect, because user name 'BLBEC' should be enclosed by
quotes. Psql 7.1 worked even withoud quotes and connected as user 'BLBEC',
while psql 7.2 fails with error:

FATAL 1: user "blbec" does not exist
Previous connection kept

Ie. psql 7.2 obviously EXPECTS quotes, while pg_dump and pg_dumpall DO NOT
GENERATE them.

bye,
--
Michal Schwarz

#2Bruce Momjian
bruce@momjian.us
In reply to: Michal Schwarz (#1)
Re: Case sensitivity in psql/pg_dump

Sorry to sound like a broken record, but this is also fixed in 7.2.1.

---------------------------------------------------------------------------

Michal Schwarz wrote:

Problem:
--------
pg_dump does not honour case-sensitivity in user names, which results to
failures when restoring database.

Environment:
------------
Version: PostgreSQL 7.2 on i686-pc-linux-gnu, compiled by GCC 2.95.2
System: Linux jtam.brno.czechin.cz 2.2.17-RAID #8 SMP Mon Oct 16 10:48:13
CEST 2000 i686 unknown

Exact steps to reproduce this bug:
----------------------------------
Run "psql template1"

template1=> CREATE USER "BLBEC" WITH CREATEDB;
CREATE USER
template1=> \c - "BLBEC"
You are now connected as new user BLBEC.
template1=> CREATE DATABASE blbectest;
CREATE DATABASE
template1=> \c blbectest "BLBEC"
You are now connected to database blbectest as user BLBEC.
template1=> CREATE TABLE test (a INT);
CREATE
template1=> \q

Then run "pg_dump blbectest". Result will contain command '\connect -
BLBEC', which is incorrect, because user name 'BLBEC' should be enclosed by
quotes. Psql 7.1 worked even withoud quotes and connected as user 'BLBEC',
while psql 7.2 fails with error:

FATAL 1: user "blbec" does not exist
Previous connection kept

Ie. psql 7.2 obviously EXPECTS quotes, while pg_dump and pg_dumpall DO NOT
GENERATE them.

bye,
--
Michal Schwarz

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michal Schwarz (#1)
Re: Case sensitivity in psql/pg_dump

Michal Schwarz <misch@czechin.cz> writes:

Ie. psql 7.2 obviously EXPECTS quotes, while pg_dump and pg_dumpall DO NOT
GENERATE them.

This is fixed in 7.2.1 (we reverted psql's behavior).

regards, tom lane