pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chao Li <li.evan.chao@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Cc: Kirill Reshke <reshkekirill@gmail.com>
Cc: jian he <jian.universality@gmail.com>
Subject: Re: psql: Fix CREATE SCHEMA scanning of nested routine bodies
Date: Wed, 24 Jun 2026 08:49:23 +0800
Message-ID: <1A9888B9-913E-4DB0-B699-21CB23B02252@gmail.com> (raw)
In-Reply-To: <802054.1782238612@sss.pgh.pa.us>
References: <8E03BB8D-003D-4850-9772-5F8015A5A0C7@gmail.com>
	<473593.1782144282@sss.pgh.pa.us>
	<7338DCF5-E04B-4E2A-A6D6-475FA4994A48@gmail.com>
	<F63EA225-9903-41A6-8CE4-1D1BDB161B24@gmail.com>
	<802054.1782238612@sss.pgh.pa.us>



> On Jun 24, 2026, at 02:16, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Chao Li <li.evan.chao@gmail.com> writes:
>> Following your suggestion, I moved the "{identifier}" logic into a new helper psqlscan_track_identifier(), and added “create_schema_identifiers" to PsqlScanStateData to track identifiers from the current top-level CREATE element within CREATE SCHEMA in the same way as the top level “identifiers". I also added a few more test cases.
> 
>> Please see the attached v2 for details.
> 
> Pushed with some mostly-cosmetic changes.

Thanks for pushing.

> Notably, I renamed the
> existing "identifiers" field to help distinguish it from the new one.
> 

The renaming makes sense.

> I didn't use your test cases because it seemed unduly expensive to do
> it that way.  We can perfectly well exercise this as part of plain-SQL
> regression testing, so I just added a booby-trap case in
> create_schema.sql Without this fix, psql marches on and tries to run
> the various \d commands after the CREATE SCHEMA before it's sent the
> CREATE SCHEMA command.  So even though no error is reported, the
> output is quite different.
> 

I think I over worried about the test. Thank for simplifying the tests.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/









view thread (6+ messages)

Message-ID: <1A9888B9-913E-4DB0-B699-21CB23B02252@gmail.com>
Permalink:  ../1A9888B9-913E-4DB0-B699-21CB23B02252@gmail.com/
Also on:    postgresql.org/message-id/1A9888B9-913E-4DB0-B699-21CB23B02252@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: li.evan.chao@gmail.com, tgl@sss.pgh.pa.us, reshkekirill@gmail.com, jian.universality@gmail.com
  Subject: Re: psql: Fix CREATE SCHEMA scanning of nested routine bodies
  In-Reply-To: <1A9888B9-913E-4DB0-B699-21CB23B02252@gmail.com>
  References: <8E03BB8D-003D-4850-9772-5F8015A5A0C7@gmail.com> <473593.1782144282@sss.pgh.pa.us> <7338DCF5-E04B-4E2A-A6D6-475FA4994A48@gmail.com> <F63EA225-9903-41A6-8CE4-1D1BDB161B24@gmail.com> <802054.1782238612@sss.pgh.pa.us> <1A9888B9-913E-4DB0-B699-21CB23B02252@gmail.com>

* 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