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
