Re: Prefixing schema name

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Prefixing schema name
Дата
Msg-id CAKFQuwYun0cHVsKhHSdOaBSMzABXYuS6JNm-VUJQLJyH8K2AFQ@mail.gmail.com
обсуждение исходный текст
Ответ на Prefixing schema name  (Tiffany Thang <tiffanythang@gmail.com>)
Ответы Re: Prefixing schema name
Список pgsql-general
On Wed, Mar 7, 2018 at 4:05 PM, Tiffany Thang <tiffanythang@gmail.com> wrote:
The search_path configuration works only for queries.

​Um....


"​A CREATE command specifying an unqualified object name creates the object in the current schema (the one at the front of the search path, which can be determined with the function current_schema)"


For example:
Is there a way to run the create/insert statements below without prefixing the schema name, user1?

As the user, user1:
Create table user1.table1 (id int);
Insert into user1.table1 values (1);

​Just omitting "user1" and seeing what happens would be informative.  You should find it does exactly what you think - namely because the default search_path will cause "user1" to appear first.

Insert is more similar to Select than it is to Create - the object being inserted into must already exist

David J.
​​

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

Предыдущее
От: Jan Bilek
Дата:
Сообщение: cached plan must not change result type
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: cached plan must not change result type