Re: CREATE SCHEMA ... CREATE DOMAIN support

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: jian he <jian.universality@gmail.com>
Cc: Kirill Reshke <reshkekirill@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-04-05T18:42:26Z
Lists: pgsql-hackers
Apropos of the question of how much rearrangement functionality the
SQL spec actually asks for, I was interested to come across this entry
in SQL:2021's Table 43 — Feature taxonomy and definition for mandatory
features:

Feature ID	Feature Name	Feature Description

F311-01		CREATE SCHEMA	— Subclause 11.1, “<schema definition>”:
				Support for circular references in that <refer-
				ential constraint definition>s in two different
				<table definition>s may reference columns in
				the other table

We already claim support for F311-01 in sql_features.txt, but based
on this entry I'd have to say that's a lie.  However, (a) the current
patchset fixes that, and (b) this seems like good evidence in support
of the idea that circular foreign keys are the only aspect of the
business that anyone cares about.

			regards, tom lane



Commits

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

  2. Execute foreign key constraints in CREATE SCHEMA at the end.

  3. Support more object types within CREATE SCHEMA.