From: Nathan Bossart <nathandbossart@gmail.com>
To: Stepan Neretin <slpmcf@gmail.com>
Cc: jian he <jian.universality@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: phb.emaj@free.fr
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18923: pg_dump 18beta1 fails to process complex table names
Date: Mon, 19 May 2025 15:30:29 -0500
Message-ID: <aCuU5dB1DF_jOxfH@nathan> (raw)
In-Reply-To: <CA+Yyo5RP7QvPOOgSS0U234HCSA5T-UStin0wkRo1Z_XY5+=VNg@mail.gmail.com>
References: <18923-e79273f87c6bed69@postgresql.org>
<37115.1747057899@sss.pgh.pa.us>
<CACJufxFLUsXw2tsTLLvWSeO0cX=Wp+fnL-vKK7eiVu0=GSSnRA@mail.gmail.com>
<aCYumTym-wLvDFp8@nathan>
<12329.1747335801@sss.pgh.pa.us>
<CACJufxF-dNsCSP-GXXZkKdKebwNKk3+3+RiQ94ir-RSn-331ug@mail.gmail.com>
<CA+Yyo5RP7QvPOOgSS0U234HCSA5T-UStin0wkRo1Z_XY5+=VNg@mail.gmail.com>
On Mon, May 19, 2025 at 02:24:47PM +0700, Stepan Neretin wrote:
> + 'CREATE SCHEMA "phil\'s schema\"3"' => {
> + create_sql => q{
> + CREATE SCHEMA "phil's schema""3";
> + SET search_path = "phil's schema""3";
> + DROP TABLE IF EXISTS "phil's tbl1";
> + CREATE TABLE "phil's tbl1" (
> + "phil's col11" serial PRIMARY KEY,
> + "phil's col12" text
> + );
> + },
> + regexp => qr/^
> + CREATE\ SCHEMA\ "phil's\ schema""3";\n
> + SET\ search_path\ =\ "phil's\ schema""3";\n
> + DROP\ TABLE\ IF\ EXISTS\ "phil's\ tbl1";\n
> + CREATE\ TABLE\ "phil's\ tbl1"\ \(\n
> + \s+"phil's\ col11"\ integer\ NOT\ NULL\ DEFAULT\ nextval\('[^']+'\)::regclass,\n
> + \s+"phil's\ col12"\ text\n
> + \s+CONSTRAINT\ "[^"]+"\ PRIMARY\ KEY\ \("phil's\ col11"\)\n
> + \);/xm,
> + like => {},
> + },
I don't think this is quite right. IIUC this test runs some commands and
makes sure that a slightly adjusted version of those commands never appears
in the dump output. This is presumably enough to reach the reported
problem, but AFAICT most of the test content is unnecessary. I think we
should simply modify an existing stats test so that we also verify the
dumped stats commands, as done in the attached patch.
--
nathan
Attachments:
[text/plain] v4-0001-pg_dump-fix-quoting-in-fetchAttributeStats.patch (0B, ../aCuU5dB1DF_jOxfH@nathan/2-v4-0001-pg_dump-fix-quoting-in-fetchAttributeStats.patch)
download
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: nathandbossart@gmail.com, slpmcf@gmail.com, jian.universality@gmail.com, tgl@sss.pgh.pa.us, phb.emaj@free.fr, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18923: pg_dump 18beta1 fails to process complex table names
In-Reply-To: <aCuU5dB1DF_jOxfH@nathan>
* 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