pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chao Li <li.evan.chao@gmail.com>
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: Tue, 23 Jun 2026 14:16:52 -0400
Message-ID: <802054.1782238612@sss.pgh.pa.us> (raw)
In-Reply-To: <F63EA225-9903-41A6-8CE4-1D1BDB161B24@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>

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.  Notably, I renamed the
existing "identifiers" field to help distinguish it from the new one.

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.

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <802054.1782238612@sss.pgh.pa.us>
Permalink:  ../802054.1782238612@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/802054.1782238612@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, li.evan.chao@gmail.com, reshkekirill@gmail.com, jian.universality@gmail.com
  Subject: Re: psql: Fix CREATE SCHEMA scanning of nested routine bodies
  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>

* 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