Re: pg_dumpall appendPQExpBuffer construct sql need an white space

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dumpall appendPQExpBuffer construct sql need an white space
Date: 2025-01-16 02:59:59
Message-ID: 1531216.1736996399@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

jian he <jian(dot)universality(at)gmail(dot)com> writes:
> in src/bin/pg_dump/pg_dumpall.c
> appendPQExpBuffer(buf, " FROM pg_auth_members a "
> "LEFT JOIN %s ur on ur.oid = a.roleid "
> "LEFT JOIN %s um on um.oid = a.member "
> "LEFT JOIN %s ug on ug.oid = 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2025-01-16 03:57:49 TOAST versus toast
Previous Message jian he 2025-01-16 02:53:51 pg_dumpall appendPQExpBuffer construct sql need an white space