Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohfBM-0004ip-V5 for pgsql-bugs@arkaria.postgresql.org; Sun, 09 Oct 2022 22:54:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ohfBK-0002Gl-QW for pgsql-bugs@arkaria.postgresql.org; Sun, 09 Oct 2022 22:54:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohfBK-0002Gb-IU for pgsql-bugs@lists.postgresql.org; Sun, 09 Oct 2022 22:54:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohfBI-0006Uo-3b for pgsql-bugs@lists.postgresql.org; Sun, 09 Oct 2022 22:54:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 299Mro1n3953508; Sun, 9 Oct 2022 18:53:50 -0400 From: Tom Lane To: Christophe Pettus cc: killerwzb@163.com, PostgreSQL mailing lists Subject: Re: BUG #17630: pg_dump error In-reply-to: <3B75DF91-FB87-4580-88CD-AF6B78ABFA80@thebuild.com> References: <17630-0947c0a5aa573243@postgresql.org> <3B75DF91-FB87-4580-88CD-AF6B78ABFA80@thebuild.com> Comments: In-reply-to Christophe Pettus message dated "Sun, 09 Oct 2022 15:20:40 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3953506.1665356030.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 09 Oct 2022 18:53:50 -0400 Message-ID: <3953507.1665356030@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Christophe Pettus writes: >> On Oct 9, 2022, at 02:22, PG Bug reporting form 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 quot= es on the command line just delimit the name of the table, but the shell s= trips 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 req= uires 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