Skip site navigation (1) Skip section navigation (2)

Re: pg_dump case folding bug

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Russell Smith <mr-russ(at)pws(dot)com(dot)au>
Cc: pgsql-bugs(at)postgreSQL(dot)org, pgsql-patches(at)postgreSQL(dot)org
Subject: Re: pg_dump case folding bug
Date: 2004-11-13 05:05:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugspgsql-patches
Russell Smith <mr-russ(at)pws(dot)com(dot)au> writes:
> pg_dump does not fold case, and quote table and schema names correctly.

This is not a bug; it is a behavior we deliberately adopted years ago,
after unsuccessful experiments with behavior like what you propose.

The rule is that names appearing on a shell command line are taken
literally, without dequoting or case folding.  Yes, this is inconsistent
with the behavior if the same string were entered within an SQL context,
but then again the command line isn't an SQL context.

The main reason for this position is that the shell imposes its own
quoting rules that we can't avoid, and these rules are not very
compatible with the SQL identifier quoting rules.  Do you *really*
want to have to type '"Test"' when you could just write Test ?

Even more to the point, the only argument in favor of adding code to do
it like this is to try to make the shell command line context just like
the SQL context, but *you can't make it so*.  If you could make "Test"
on the command line work just like "Test" in SQL it'd be great ... but
you can't because the shell will strip the double quotes before you ever
see them.

We went around a few times on this, but eventually decided it was
unhelpful to try to emulate the SQL quoting behavior.

BTW, this behavior is consistent across all our command-line tools;
if we did want to change it it'd affect much more than just pg_dump.

			regards, tom lane

In response to


pgsql-bugs by date

Next:From: Russell SmithDate: 2004-11-13 10:47:50
Subject: Re: pg_dump case folding bug
Previous:From: Russell SmithDate: 2004-11-13 03:51:47
Subject: pg_dump case folding bug

pgsql-patches by date

Next:From: Robert TreatDate: 2004-11-13 05:51:37
Subject: Give the TODO list a little more verbose explanation
Previous:From: Russell SmithDate: 2004-11-13 03:51:47
Subject: pg_dump case folding bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group