BUG #5765: pg_dump fail to find upper case table name

Started by Cristianoover 15 years ago5 messagesbugs
Jump to latest
#1Cristiano
sumariva@gmail.com

The following bug has been logged online:

Bug reference: 5765
Logged by: Cristiano
Email address: sumariva@gmail.com
PostgreSQL version: 8.4.4
Operating system: Linux
Description: pg_dump fail to find upper case table name
Details:

The following command line did not worked.
Using a table with lower case chars( no quoting ) works.
Also happen on pg_dump windows version.
Tested on 8.4.4 and 8.4.3

pg_dump --host www --port 5432 --username postgres --format plain
--column-inserts --verbose --file "streetTypes.sql" --table
public."streetTypes" "geocoding-dev"
Password:
pg_dump: No matching tables were found
pg_dump: *** aborted because of error

Test case: just create an table that need quoting.
CREATE TABLE "Test"() WITH ( OIDS=FALSE );

Call pg_dump to export.

pg_dump --host localhost --port 5432 --username postgres --format plain
--column-inserts --verbose --file "test.sql" --table public."Test" "test-db"

#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Cristiano (#1)
Re: BUG #5765: pg_dump fail to find upper case table name

On 24.11.2010 13:34, Cristiano wrote:

pg_dump --host www --port 5432 --username postgres --format plain
--column-inserts --verbose --file "streetTypes.sql" --table
public."streetTypes" "geocoding-dev"
Password:
pg_dump: No matching tables were found
pg_dump: *** aborted because of error

Test case: just create an table that need quoting.
CREATE TABLE "Test"() WITH ( OIDS=FALSE );

Call pg_dump to export.

pg_dump --host localhost --port 5432 --username postgres --format plain
--column-inserts --verbose --file "test.sql" --table public."Test" "test-db"

Manual says (at the bottom of
http://www.postgresql.org/docs/8.4/static/app-pgdump.html):

To specify an upper-case or mixed-case name in -t and related switches, you need to double-quote the name; else it will be folded to lower case (see Patterns). But double quotes are special to the shell, so in turn they must be quoted. Thus, to dump a single table with a mixed-case name, you need something like

$ pg_dump -t '"MixedCaseName"' mydb > mytab.sql

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#3Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Heikki Linnakangas (#2)
Re: BUG #5765: pg_dump fail to find upper case table name

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote:

Manual says (at the bottom of
http://www.postgresql.org/docs/8.4/static/app-pgdump.html):

To specify an upper-case or mixed-case name in -t and related
switches, you need to double-quote the name; else it will be
folded to lower case (see Patterns). But double quotes are
special to the shell, so in turn they must be quoted. Thus, to
dump a single table with a mixed-case name, you need something
like

$ pg_dump -t '"MixedCaseName"' mydb > mytab.sql

Perhaps some of that should be moved up to the definition of the -t
switch? It wouldn't seem too out of place to me to put it somewhere
near this sentence:

| When using wildcards, be careful to quote the pattern if needed to
| prevent the shell from expanding the wildcards.

While examples are useful, information which is only provided there
is easily missed when someone goes to read up on a particular
switch.

-Kevin

#4Pavlo Golub
pavlo.golub@cybertec.at
In reply to: Kevin Grittner (#3)
Re: BUG #5765: pg_dump fail to find upper case table name

Hello, Kevin.

You wrote:

KG> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote:
KG>

Manual says (at the bottom of
http://www.postgresql.org/docs/8.4/static/app-pgdump.html):

To specify an upper-case or mixed-case name in -t and related
switches, you need to double-quote the name; else it will be
folded to lower case (see Patterns). But double quotes are
special to the shell, so in turn they must be quoted. Thus, to
dump a single table with a mixed-case name, you need something
like

$ pg_dump -t '"MixedCaseName"' mydb > mytab.sql

KG>
KG> Perhaps some of that should be moved up to the definition of the -t
KG> switch? It wouldn't seem too out of place to me to put it somewhere
KG> near this sentence:
KG>
KG> | When using wildcards, be careful to quote the pattern if needed to
KG> | prevent the shell from expanding the wildcards.

+100

KG>
KG> While examples are useful, information which is only provided there
KG> is easily missed when someone goes to read up on a particular
KG> switch.
KG>
KG> -Kevin

--
With best wishes,
Pavel mailto:pavel@gf.microolap.com

#5Bruce Momjian
bruce@momjian.us
In reply to: Kevin Grittner (#3)
Re: BUG #5765: pg_dump fail to find upper case table name

Kevin Grittner wrote:

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote:

Manual says (at the bottom of
http://www.postgresql.org/docs/8.4/static/app-pgdump.html):

To specify an upper-case or mixed-case name in -t and related
switches, you need to double-quote the name; else it will be
folded to lower case (see Patterns). But double quotes are
special to the shell, so in turn they must be quoted. Thus, to
dump a single table with a mixed-case name, you need something
like

$ pg_dump -t '"MixedCaseName"' mydb > mytab.sql

Perhaps some of that should be moved up to the definition of the -t
switch? It wouldn't seem too out of place to me to put it somewhere
near this sentence:

| When using wildcards, be careful to quote the pattern if needed to
| prevent the shell from expanding the wildcards.

While examples are useful, information which is only provided there
is easily missed when someone goes to read up on a particular
switch.

I have applied the attached doc patch to reference the example section
from the specific pg_dump options sections.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachments:

/rtmp/pg_dump.difftext/x-diffDownload+8-8