Re: Support for CREATE MODULE?

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема Re: Support for CREATE MODULE?
Дата
Msg-id 09820999-b84d-4046-a45f-4eacf92ff3ca@www.fastmail.com
обсуждение исходный текст
Ответ на Re: Support for CREATE MODULE?  (Jim Mlodgenski <jimmy76@gmail.com>)
Список pgsql-hackers
On Wed, Jun 2, 2021, at 16:43, Jim Mlodgenski wrote:
On Wed, Jun 2, 2021 at 9:58 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I wonder whether it'd be better to consider modules as a kind of
> extension, or at least things with the same sort of ownership relations
> as extensions have.

That would solve the problem of associating objects which is the larger
problem for users today. The objects can all live in their respective
schemas with the module tying them all together.

I like the idea of somehow using extensions.

Right now, extensions can only be added from the command-line, via `make install`.

But maybe a new extension could be packaged from the SQL prompt, out of existing database objects that are not already part of an extension?

Maybe the interface could be:

init_new_extension(extension_name text) function, to register a new empty extension.
add_object_to_extension(extension_name text, type text, object_names text[], object_args text[])

Then, if dropping the extension, all objects would be dropped, and if creating the extension, all objects would be restored.

I don't have an idea on how to handle update scripts, but since it's not mandatory to provide extension update scripts, maybe that's not a problem.

/Joel

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Support for CREATE MODULE?
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: pg_stat_progress_create_index vs. parallel index builds