postgresql/src/bin/scripts/t
Andrew Dunstan b380a56a3f Disallow CR and LF in database, role, and tablespace names
Previously, these characters could cause problems when passed through
shell commands, and were flagged with a comment in string_utils.c
suggesting they be rejected in a future major release.

The affected commands are CREATE DATABASE, CREATE ROLE, CREATE TABLESPACE,
ALTER DATABASE RENAME, ALTER ROLE RENAME, and ALTER TABLESPACE RENAME.

Also add a pg_upgrade check to detect these invalid names in clusters
being upgraded from pre-v19 versions, producing a report file listing
any offending objects that must be renamed before upgrading.

Tests have been modified accordingly.

Author: Mahendra Singh Thalor <mahi6run@gmail.com>
Reviewed-By: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-By: Andrew Dunstan <andrew@dunslane.net>
Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-By: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-By: Srinath Reddy <srinath2133@gmail.com>

Discussion: https://postgr.es/m/CAKYtNApkOi4FY0S7+3jpTqnHVyyZ6Tbzhtbah-NBbY-mGsiKAQ@mail.gmail.com
2026-02-23 11:19:13 -05:00
..
010_clusterdb.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
011_clusterdb_all.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
020_createdb.pl Disallow CR and LF in database, role, and tablespace names 2026-02-23 11:19:13 -05:00
040_createuser.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
050_dropdb.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
070_dropuser.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
080_pg_isready.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
090_reindexdb.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
091_reindexdb_all.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
100_vacuumdb.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
101_vacuumdb_all.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
102_vacuumdb_stages.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
200_connstr.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00