Re: A different approach to extension NO USER DATA feature

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: A different approach to extension NO USER DATA feature
Дата
Msg-id 15843.1297092121@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: A different approach to extension NO USER DATA feature  (Richard Huxton <dev@archonet.com>)
Список pgsql-hackers
Richard Huxton <dev@archonet.com> writes:
> Possible alternative approach?

> 1. Extension provides list of config tables/views/set-returning 
> functions to be dumped via e.g. my_config_tables()
> 2. They get dumped, but each as a TEMP TABLE (need unique names for 
> multiple extensions though).
> 3. On restore, tables are created and populated, then 
> read_your_config(<ARRAY-OF-TABLE-NAMES>) is called in the extension.

This is kind of problematic because it requires those tables to be
created before the extension is created.  One difficulty with that is it
would break parallel pg_restore.  Another is that it's not unusual for
the config tables to not be populatable at all before the extension's
been loaded.  For example, IIRC how the old contrib/tsearch2 config
tables worked, there were regproc columns that contained references to
functions created by tsearch2.

It is true that the extension author may sometimes need to run some code
when the user-provided data is loaded into the config table, but in the
design I suggested, that could be handled by attaching triggers to the
config table.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: A different approach to extension NO USER DATA feature
Следующее
От: Cédric Villemain
Дата:
Сообщение: Re: Spread checkpoint sync