Re: BUG #17630: pg_dump error - Mailing list pgsql-bugs

From Christophe Pettus
Subject Re: BUG #17630: pg_dump error
Date
Msg-id 3B75DF91-FB87-4580-88CD-AF6B78ABFA80@thebuild.com
Whole thread Raw
In response to BUG #17630: pg_dump error  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #17630: pg_dump error
List pgsql-bugs

> On Oct 9, 2022, at 02:22, PG Bug reporting form <noreply@postgresql.org> wrote:
>    I create table with a upper name ,it is "TABLE2" .I use pg_dump to dump
> the table to a custom file,but i get some error.

It's not a bug, but it's kind of an annoying situation.  The double quotes on the command line just delimit the name of
thetable, but the shell strips them off (as you would expect), so pg_dump just gets the bare name.  You have to add
separate,escaped double-quotes, since the table name requires them: 

xof=# create table "TABLE2" (i integer);
CREATE TABLE
xof=#
\q
xof$ pg_dump --dbname=xof --table "TABLE2" > /dev/null
pg_dump: error: no matching tables were found
xof$ pg_dump --dbname=xof --table "\"TABLE2\"" > /dev/null
xof$




pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17630: pg_dump error
Next
From: Tom Lane
Date:
Subject: Re: BUG #17630: pg_dump error