Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tYG71-0075CD-Ku for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jan 2025 03:00:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tYG70-0046sd-49 for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jan 2025 03:00:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tYG6z-0046sU-QS for pgsql-hackers@lists.postgresql.org; Thu, 16 Jan 2025 03:00:02 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tYG6z-000dYr-0K for pgsql-hackers@postgresql.org; Thu, 16 Jan 2025 03:00: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 50G2xxRv1531217; Wed, 15 Jan 2025 21:59:59 -0500 From: Tom Lane To: jian he cc: PostgreSQL-development Subject: Re: pg_dumpall appendPQExpBuffer construct sql need an white space In-reply-to: References: Comments: In-reply-to jian he message dated "Thu, 16 Jan 2025 10:53:51 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1531215.1736996399.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 15 Jan 2025 21:59:59 -0500 Message-ID: <1531216.1736996399@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk jian he writes: > in src/bin/pg_dump/pg_dumpall.c > appendPQExpBuffer(buf, " FROM pg_auth_members a " > "LEFT JOIN %s ur on ur.oid =3D a.roleid " > "LEFT JOIN %s um on um.oid =3D a.member " > "LEFT JOIN %s ug on ug.oid =3D a.grantor " > "WHERE NOT (ur.rolname ~ '^pg_' AND um.rolname ~ '= ^pg_')" > "ORDER BY 1,2,4", role_catalog, role_catalog, > role_catalog); > here "WHERE NOT (ur.rolname ~ '^pg_' AND um.rolname ~ '^pg_')" > need a white space at the end? The right paren is its own token in any case, so we don't need a space for correctness. You could argue that it'd improve readability, but who reads pg_dumpall's queries? regards, tom lane