Re: Multiple Schema and extensions

Поиск
Список
Период
Сортировка
Искать
От
Albe Laurenz
Тема
Re: Multiple Schema and extensions
Дата
Msg-id
D960CB61B694CF459DCFB4B0128514C20874BE68@exadv11.host.magwien.gv.at
Ответ на
Список
Дерево обсуждения
Multiple Schema and extensions Alan Nilsson <anilsson@apple.com>
Re: Multiple Schema and extensions "Albe Laurenz" <laurenz.albe@wien.gv.at>
Alan Nilsson wrote:
> Is it the case that extensions can be added to only one schema?  If
so, what is the recommended
> practice for accessing a function from an extension in multiple
schemas?

Yes, a (relocatable) extension can belong to only one schema.
There are two ways to access the functions:
1) Use qualified names.
2) Set search_path to contain the schema.

> Is it *ok* to load the extension in the pg_catalog schema so functions
can be accessed by unqualified
> names?  Is it *better* to have a separate schema for functions and use
qualified names to access?
> What is the general accepted practice?

No, that is not ok.
pg_catalog is only for system objects.
You should use schema "public" - that is in search_path by
default, and everybody can use it.

> As a side note:
> ALTER EXTENSION foo ADD SCHEMA bar
> What the heck does this do?  AFICS, it has no effect on the visibility
of an extension function in the
> *added* schema.

This makes "bar" belong to extension "foo", not the other way around.
The effect is that
a) "bar" will not be dumped by pg_dump
b) "DROP EXTENSION foo" will drop schema "bar"

Yours,
Laurenz Albe

В списке pgsql-general по дате отправления
От: Albe Laurenz
Дата:
От: Albe Laurenz
Дата:
FAQ