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.96) (envelope-from ) id 1wc5gA-00351F-1R for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jun 2026 18:16:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wc5g9-00DGED-0f for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jun 2026 18:16:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wc5g8-00DGE5-30 for pgsql-hackers@lists.postgresql.org; Tue, 23 Jun 2026 18:16:56 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wc5g6-00000001y20-3hyV for pgsql-hackers@lists.postgresql.org; Tue, 23 Jun 2026 18:16:56 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 65NIGqNC802055; Tue, 23 Jun 2026 14:16:52 -0400 From: Tom Lane To: Chao Li cc: Postgres hackers , Kirill Reshke , jian he Subject: Re: psql: Fix CREATE SCHEMA scanning of nested routine bodies In-reply-to: References: <8E03BB8D-003D-4850-9772-5F8015A5A0C7@gmail.com> <473593.1782144282@sss.pgh.pa.us> <7338DCF5-E04B-4E2A-A6D6-475FA4994A48@gmail.com> Comments: In-reply-to Chao Li message dated "Tue, 23 Jun 2026 16:13:43 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <802053.1782238612.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 23 Jun 2026 14:16:52 -0400 Message-ID: <802054.1782238612@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Chao Li writes: > Following your suggestion, I moved the "{identifier}" logic into a new h= elper psqlscan_track_identifier(), and added =E2=80=9Ccreate_schema_identi= fiers" to PsqlScanStateData to track identifiers from the current top-leve= l CREATE element within CREATE SCHEMA in the same way as the top level =E2= =80=9Cidentifiers". 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