Re: [BUGS] Patch to allow C extension modules to initialize/finish

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: [BUGS] Patch to allow C extension modules to initialize/finish
Дата
Msg-id 87wt9ootau.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: [BUGS] Patch to allow C extension modules to initialize/finish  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [BUGS] Patch to allow C extension modules to initialize/finish
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Gregory Stark <gsstark@mit.edu> writes:
> > So, for example if for someone wanted to
> > have a persistent Oracle connection they could not open it pre-fork at library
> > load time but they might want to open it immediately after the fork rather
> > than when it's first used.
> 
> Uh ... why?  Seems like all you're accomplishing there is to expend
> cycles that might be wasted, if the particular session never uses
> the feature.

Well as long as we're talking hypothetically I could come up with plenty.
Maybe you know every session will be using the connection and you can't deal
with the latency creating the connection may create in your critical path. Or
maybe you don't want to deal with connection errors from the depths of your
call tree where it'll cause a user-visible error. Or perhaps you're using some
library that expects to be handed a connection from some initialization
routine and it's just not convenient to or possible to invoke that on an
on-demand basis.

> In any case, the PG_init proposal neither adds nor takes away ability
> to do stuff immediately post-fork, so I think that's an orthogonal
> consideration.

So is the only question whether there's a need to do stuff pre-fork?

-- 
greg



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 8.2 features status
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 8.2 features status