pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christophe Pettus <xof@thebuild.com>
Cc: killerwzb@163.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17630: pg_dump error
Date: Sun, 09 Oct 2022 18:53:50 -0400
Message-ID: <3953507.1665356030@sss.pgh.pa.us> (raw)
In-Reply-To: <3B75DF91-FB87-4580-88CD-AF6B78ABFA80@thebuild.com>
References: <17630-0947c0a5aa573243@postgresql.org>
	<3B75DF91-FB87-4580-88CD-AF6B78ABFA80@thebuild.com>

Christophe Pettus <xof@thebuild.com> writes:
>> 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 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:

Another way with slightly fewer keystrokes is

	pg_dump ... --table '"TABLE2"'

Of course, if you're also in the habit of putting single-quotes in
your table names, that'll still need some work.  The main point is
that there are two layers of quoting that you have to deal with:
the shell's, and then SQL's.

			regards, tom lane





view thread (3+ messages)

Message-ID: <3953507.1665356030@sss.pgh.pa.us>
Permalink:  ../3953507.1665356030@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3953507.1665356030@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, xof@thebuild.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17630: pg_dump error
  In-Reply-To: <3953507.1665356030@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox