public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: jian he <[email protected]>
Cc: Kirill Reshke <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: CREATE SCHEMA ... CREATE DOMAIN support
Date: Sun, 05 Apr 2026 23:04:55 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CACJufxEwkAJuCutLQdsxCOJkAvDS=9KgbphMVkXtQP8te=nciA@mail.gmail.com>
References: <CALdSSPh4jUSDsWu3K58hjO60wnTRR0DuO4CKRcwa8EVuOSfXxg@mail.gmail.com>
	<CACJufxG+mrh2O9RS0gX43gU6sv+CMY847eMjMQpe8t4ou-2ryg@mail.gmail.com>
	<CACJufxFUdgqDiK9B+VNtnAwZOj=O3NqdLtXO_OrOwE5XPdCpBA@mail.gmail.com>
	<CALdSSPggNNvcad69dhUceZ_gPuEYnKNNd=WJ_WnP=YDmh=iwmw@mail.gmail.com>
	<[email protected]>
	<CALdSSPhckRXW+KEvdsUmkQ-ErbrP_vPNjGwgXNdpXDb8xnLEbQ@mail.gmail.com>
	<[email protected]>
	<CALdSSPgftbtV=UyeK_XcLit_mKQZr+g8pCxA0kLLxDi0kKwEGw@mail.gmail.com>
	<CACJufxH5TvkQiMOJ9dpDrDbRtyCa-yu+QOmYGt4WGGYVrN+P8g@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CALdSSPi1eFMhAY6Xc7ZShnU0m5YrswOFLyDKrFzLjYd7wefzQg@mail.gmail.com>
	<[email protected]>
	<CACJufxF28Vk27JhJ9u8tq10BoHLg=T9=wJ8zqTy_ajM4=Czunw@mail.gmail.com>
	<CALdSSPjH3Ag_6v=Q+mnhJocaYor0eGYOYkZWDG8w2rXRVioTXw@mail.gmail.com>
	<[email protected]>
	<CACJufxG7okkEs+kjCxR0b=6! [email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CACJufxEwkAJuCutLQdsxCOJkAvDS=9KgbphMVkXtQP8te=nciA@mail.gmail.com>

jian he <[email protected]> writes:
> On Mon, Apr 6, 2026 at 4:15 AM Tom Lane <[email protected]> wrote:
>> I rewrote 0002 rather heavily, mainly because it assumed it could
>> scribble on the input query tree which I don't think is okay.

> But there is still no explanation about why it's not ok to scribble on
> the input query tree.

Because it might be in a cached plan tree and thus subject to being
re-used.  Now, you could sort of get away with that as long as
whatever changes you make are idempotent.  But palloc'ing new nodes
in the current memory context and then putting links to them into the
possibly-longer-lived source tree will not work.  On the whole I think
it'd be too fragile.

See also [1].  I didn't get a chance to make that happen during v19,
but it's still on the radar, and once it happens this sort of shortcut
would definitely fail.

> it would be better change to
> + errmsg("CREATE specifies a schema (%s) different from the one being
> created (%s)",
> It's better for regex pattern searching, for new line you need to know
> how to escape.

I made it look the same as the existing copy of the message.
I'm not too worried about the line break where it is; I doubt
anyone would be doing a code search that would fail because
of that.  Breaking in the middle of either phrase of the
message would be bad, agreed.

			regards, tom lane

[1] https://www.postgresql.org/message-id/2531459.1743871597%40sss.pgh.pa.us





view thread (32+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: CREATE SCHEMA ... CREATE DOMAIN support
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox