pgsql: Revert "Don't try to re-order the subcommands of CREATE SCHEMA".

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Revert "Don't try to re-order the subcommands of CREATE SCHEMA".
Date: 2026-09-11 15:38:22
Message-ID: E1x53KX-00000004S78-3mlP@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Revert "Don't try to re-order the subcommands of CREATE SCHEMA".

This reverts commit a9c350d9ee66745aadcf7c0c95a567752a762171.
While that intentionally changed our semantics for CREATE SCHEMA
subcommands, it's being argued that the functionality gain does
not justify potentially-subtle compatibility breakage. The most
useful bit of functionality gain came from commit 404db8f9e
("Execute foreign key constraints in CREATE SCHEMA at the end"),
which we're keeping because it's required by SQL spec and doesn't
seem to create a compatibility hazard by itself.

This is not an exact revert, partly because we're keeping 404db8f9e,
and partly because I kept the API changes that allowed passing down
a ParseState (which allows providing an error cursor for many of the
errors thrown in CREATE SCHEMA).

Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/20260904180712.cc.noahmisch@microsoft.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e0fdc3f54b417daeca957eb95b5eb04a418cc3bf

Modified Files
--------------
doc/src/sgml/ref/create_schema.sgml | 23 +++---
src/backend/commands/schemacmds.c | 7 +-
src/backend/parser/parse_utilcmd.c | 116 +++++++++++++++++++---------
src/test/regress/expected/create_schema.out | 7 --
src/test/regress/expected/event_trigger.out | 2 +-
src/test/regress/expected/namespace.out | 9 +--
src/test/regress/sql/create_schema.sql | 5 --
src/test/regress/sql/namespace.sql | 11 ++-
src/tools/pgindent/typedefs.list | 1 +
9 files changed, 102 insertions(+), 79 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-09-11 15:51:18 pgsql: Doc: update v19 release notes for reversion of a9c350d9e.
Previous Message Álvaro Herrera 2026-09-11 11:44:35 pgsql: Disallow REPACK (CONCURRENTLY) when replica identity index is dr