Re: CREATE SCHEMA still resolves unqualified type names in pg_temp

From: Joao Rito <joaovictor(dot)rito(at)gmail(dot)com>
To: Ayoub Kazar <ayoub(dot)kazar(at)data-bene(dot)io>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: CREATE SCHEMA still resolves unqualified type names in pg_temp
Date: 2026-11-14 21:33:30
Message-ID: 20261114213330.214-1-joaovictor.rito@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Ayoub,

I tested the patch on current master (206e719, built with cassert and tap tests) and it applies cleanly. Before the patch, a column type and a domain created in CREATE SCHEMA resolved to pg_temp, and an FK, view or LIKE pointing at a table created earlier in the same statement failed with the "permanent tables may reference only permanent tables" error. After the patch all of them resolve to the new schema, an explicit pg_temp at the front of the old path is still honored, and the regress suite passes (243 subtests).

What I did not test: the isolation and tap suites, pgindent and the docs.

Small suggestions: the new test could also cover a DOMAIN, a VIEW and LIKE (they work for me), and the commit message could mention b6dae498dfa. I also wondered about your own question on whether pg_temp should come last in the search path; the documentation for search_path does not mention CREATE SCHEMA, so maybe a short note is worth adding. I have no objection to the approach.

Regards,
Joao Rito

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joao Rito 2026-11-14 21:34:40 Re: Fix ReadStream handling when heap rescan strategy changes
Previous Message Lukas Fittl 2026-11-14 20:50:41 Re: [PATCH] auto_explain: preserve per-query sampling decisions (#19877)