Re: Feedback on writing extensible modules

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: Feedback on writing extensible modules
Дата
Msg-id 871vou9ovg.fsf@hi-media-techno.com
обсуждение исходный текст
Ответ на Re: Feedback on writing extensible modules  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Dimitri Fontaine <dfontaine@hi-media.com> writes:
>> Please find attached a little little patch which run
>> process_local_preload_libraries from within a transaction.
>
> This is inevitably going to break other people's code.  Put the
> transaction wrapper in your own stuff if you have to have it.

The module is working fine on HEAD without any patch if it cares about
starting a transaction itself into _PG_init(), even when _PG_init() is
called at function call time rather than at local_preload_libraries
time.

My reserve was that I thought the transaction arround _PG_init() was
existing in a 'normal' call, so the explicit creation of it in the
module would fail:   StartTransactionCommand();   ...   CommitTransactionCommand();

Now my only problem is related to making the module 8.3 compliant:

pre_prepare.c:19:27: error: utils/snapmgr.h: No such file or directory
pre_prepare.c: In function ‘_PG_init’:
pre_prepare.c:188: warning: implicit declaration of function ‘PushActiveSnapshot’
pre_prepare.c:207: warning: implicit declaration of function ‘PopActiveSnapshot’

I guess I can document that having pre_prepare in
local_preload_libraries with preprepare.at_init = on is only support
from 8.4 onward...

Regards,
--
dim


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: tsvector extraction patch
Следующее
От: Fujii Masao
Дата:
Сообщение: FYI: fdatasync vs sync_file_range