Re: BUG #17630: pg_dump error

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: killerwzb(at)163(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17630: pg_dump error
Date: 2022-10-09 22:20:40
Message-ID: 3B75DF91-FB87-4580-88CD-AF6B78ABFA80@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On Oct 9, 2022, at 02:22, PG Bug reporting form <noreply(at)postgresql(dot)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 the table, 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$

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-10-09 22:53:50 Re: BUG #17630: pg_dump error
Previous Message PG Bug reporting form 2022-10-09 09:22:38 BUG #17630: pg_dump error