Revert "Support more object types within CREATE SCHEMA".
This reverts commit d516974840f4059d331ae6057ede3e4edd3c6747,
along with parts of commit 049b742daad0965be4a846035408ae27ce1f9e14
("psql: Tighten heuristics for BEGIN/END within CREATE SCHEMA").
While there's nothing particularly wrong with d51697484 in itself,
it depends on a9c350d9e ("Don't try to re-order the subcommands of
CREATE SCHEMA"), and concerns have been raised that the compatibility
impact of that outweighs the benefit of allowing more object types
within CREATE SCHEMA.
It's not possible to revert 049b742da verbatim, because the
CVE-2026-6464 patches 3045a25ba ("Teach psql to skip in-line COPY
... FROM STDIN data after a failure") and cf754f741 ("Save/restore
more lexer state when skipping text due to \if") depend on
infrastructure it added. Instead, rip out just the bits specifically
needed to parse CREATE FUNCTION within CREATE SCHEMA. This results in
lexer code that matches v18-and-earlier as modified by CVE-2026-6464.
Author: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 19
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/3c5d28ba64e2b9a309076106cf0b66a013eaf180
Modified Files
--------------
doc/src/sgml/ref/create_schema.sgml | 25 +---
src/backend/parser/gram.y | 3 -
src/backend/parser/parse_utilcmd.c | 88 ------------
src/bin/psql/psqlscanslash.l | 8 --
src/bin/psql/tab-complete.in.c | 22 ++-
src/fe_utils/psqlscan.l | 61 ++-------
src/include/fe_utils/psqlscan_int.h | 6 -
.../test_ddl_deparse/expected/create_schema.out | 38 +-----
.../modules/test_ddl_deparse/sql/create_schema.sql | 18 +--
src/test/regress/expected/create_schema.out | 147 +--------------------
src/test/regress/sql/create_schema.sql | 81 +-----------
11 files changed, 31 insertions(+), 466 deletions(-)