[PG19] CREATE SCHEMA puts an index or trigger on a same-named temp table
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
This thread has been committed, so CI has stopped here. Anything below is the last result it produced.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t254248psql -h localhost -U postgresBuilt from patchset v1 (message #1), October 22, 2026 at 06:16 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t254248_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t254248_1 && git checkout t254248_1Patchset v1 (message #1) is on t254248_1
Hi hackers,
This is Low item 2 from my list of 19 bugs in [1].
In v18 an unqualified CREATE SCHEMA element got the new schema's name
filled in. a9c350d9e stopped doing that, and the revert in 962e0a723
(e0fdc3f54b4 in 19) kept it.
So the name now goes through search_path, where pg_temp comes first:
create temp table t (a int);
create schema s
create table t (a int)
create index i on t (a);
On 19 and master the index lands on the temp table, with no error. A
trigger does the same, a foreign key in s.t fails, and a view on t
quietly becomes a temp view. v18 puts them in s, or raises an error
for the view.
0001 address it by fills in the name again as v18 did, on a copy of
the elements.
Thanks,
Shihao
shihao zhong <zhong950419@gmail.com> writes:
In v18 an unqualified CREATE SCHEMA element got the new schema's name
filled in. a9c350d9e stopped doing that, and the revert in 962e0a723
(e0fdc3f54b4 in 19) kept it.
So the name now goes through search_path, where pg_temp comes first:
Ooops, good catch. The patch needed some more work on comments,
and I also chose to go back to the old function naming
"setSchemaName..." instead of "checkSchemaName...", but the functional
correction is fine. Pushed.
regards, tom lane