On Fri, Feb 22, 2019 at 1:14 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > Why? It would likely be a significant amount of effort and added overhead, > to accomplish no obviously-useful goal. > > Note that all the temp schemas are made as owned by the bootstrap > superuser, so there is no real argument to be made that people might > be expecting they should be able to delete them.
Hmm, well maybe you're right. Just seems like an odd wart.
Well, the way it works now is you can drop them. But if you then create another temp table in the same session, it will get an oid of the already dropped schema in the relnamespace column.
That just seems plain broken.
I think we need to either prevent dropping of temp namespaces *or* we need to create a new entry in pg_namespace in this particular case.
I wonder if other "fun" things could happen if you go rename the namespace, haven't tried that yet...