pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Nathan Bossart <nathandbossart@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: jian he <jian.universality@gmail.com>
Cc: Kirill Reshke <reshkekirill@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: CREATE SCHEMA ... CREATE DOMAIN support
Date: Wed, 9 Sep 2026 11:02:38 -0700
Message-ID: <20260909180238.b9.noahmisch@microsoft.com> (raw)
In-Reply-To: <627673.1788972291@sss.pgh.pa.us>
References: <1838711.1775503188@sss.pgh.pa.us>
	<20260904002924.a7.noahmisch@microsoft.com>
	<1504966.1788483626@sss.pgh.pa.us>
	<20260904035154.0b.noahmisch@microsoft.com>
	<1566169.1788531712@sss.pgh.pa.us>
	<20260904180712.cc.noahmisch@microsoft.com>
	<1584523.1788550238@sss.pgh.pa.us>
	<57046562-8fe6-4663-b4d7-724d195f38f7@iki.fi>
	<aqGGiZfONuhkd25F@nathan>
	<627673.1788972291@sss.pgh.pa.us>

On Wed, Sep 09, 2026 at 12:44:51PM -0400, Tom Lane wrote:
> Nathan Bossart <nathandbossart@gmail.com> writes:
> > On Wed, Sep 09, 2026 at 06:53:58PM +0300, Heikki Linnakangas wrote:
> >> Reverting seems like the safest thing to do. This is a really niche thing,
> >> but whatever behavior we pick, we'll be stuck with it for a long time. If
> >> we're not 100% certain about the new behavior, better to take a step back
> >> and discuss and design it with more time.
> 
> > +1
> 
> After looking at the git history a bit, the relevant commits are
> 
> Branch: master Release: REL_19_BR [049b742da] 2026-06-23 14:12:03 -0400
>     psql: Tighten heuristics for BEGIN/END within CREATE SCHEMA.
> Branch: master Release: REL_19_BR [d51697484] 2026-04-06 15:16:25 -0400
>     Support more object types within CREATE SCHEMA.
> Branch: master Release: REL_19_BR [404db8f9e] 2026-04-06 15:16:25 -0400
>     Execute foreign key constraints in CREATE SCHEMA at the end.
> Branch: master Release: REL_19_BR [a9c350d9e] 2026-04-06 15:16:25 -0400
>     Don't try to re-order the subcommands of CREATE SCHEMA.
> 
> It looks like it might be possible to revert a9c350d9e and d51697484
> while keeping 404db8f9e, which would preserve a feature clearly
> required by the SQL standard (F311-01, "Support for circular
> references in that <referential constraint definition>s in two
> different <table definition>s may reference columns in the other
> table") while not breaking compatibility with our pre-19 behavior.
> Any opinions about whether that's a good thing to try to do, rather
> than a wholesale revert?

I don't have concerns specific to that change.  In general, since the changes
were part of a composed series, I'd ascribe non-negligible risk to keeping
just part of the series.  Maybe leave it in master but revert from v19?  On
the other hand, the change is contained to a low-risk topic.  I don't have a
strong preference between those choices.

> I'm also inclined to keep this bit of 049b742da:
> 
>     This patch also fixes what seems to me (tgl) a small bug: \;
>     would reset BEGIN/END detection even when inside parens or BEGIN.
>     That's unlike what a plain semicolon would do, and no such effect
>     is suggested by the documentation.

What's a command that notices the difference?  Something like a sql-standard
function body where the user backslashed the semicolons even though it wasn't
necessary?

I agree it's conceptually right to keep that bit.  Resetting detection makes
sense at an unescaped semicolon that ends the query buffer, but that doesn't
extend to an escaped semicolon.  I'm somewhat struggling to map out the
implications for existing scripts, but that's fair for a major release.






view thread (55+ messages)  latest in thread

Message-ID: <20260909180238.b9.noahmisch@microsoft.com>
Permalink:  ../20260909180238.b9.noahmisch@microsoft.com/
Also on:    postgresql.org/message-id/20260909180238.b9.noahmisch@microsoft.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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: noah@leadboat.com, tgl@sss.pgh.pa.us, nathandbossart@gmail.com, hlinnaka@iki.fi, jian.universality@gmail.com, reshkekirill@gmail.com, peter@eisentraut.org, pgsql-hackers@lists.postgresql.org
  Subject: Re: CREATE SCHEMA ... CREATE DOMAIN support
  In-Reply-To: <20260909180238.b9.noahmisch@microsoft.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