Prevent extension creation in temporary schemas

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Prevent extension creation in temporary schemas
Дата
Msg-id 20190107032612.GB22498@paquier.xyz
обсуждение исходный текст
Ответы Re: Prevent extension creation in temporary schemas  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi all,

While looking at another bug I have noticed that it is possible to
create an extension directly using a temporary schema, which is
crazy.  A simple example:
=# create extension pg_prewarm with schema pg_temp_3;
CREATE EXTENSION
=# \dx pg_prewarm
           List of installed extensions
    Name    | Version |  Schema   |      Description
------------+---------+-----------+-----------------------
 pg_prewarm | 1.2     | pg_temp_3 | prewarm relation data
(1 row)

When also creating some extensions, like pageinspect, then the error
message gets a bit crazier, complaining about things not existing.
This combination makes no actual sense, so wouldn't it be better to
restrict the case?  When trying to use ALTER EXTENSION SET SCHEMA we
already have a similar error:
=# alter extension pageinspect set schema pg_temp_3;
ERROR:  0A000: cannot move objects into or out of temporary schemas
LOCATION:  CheckSetNamespace, namespace.c:2954

Attached is an idea of patch, the test case is a bit bulky to remain
portable though.

Thoughts?
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Karl O. Pinc"
Дата:
Сообщение: Doc client_min_messages patch vis. INFO message severity
Следующее
От: Amit Langote
Дата:
Сообщение: Re: [Sender Address Forgery]Re: error message when subscriptiontarget is a partitioned table