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

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gregory Stark <gsstark(at)mit(dot)edu>, Joe Conway <mail(at)joeconway(dot)com>, David Fetter <david(at)fetter(dot)org>, rse(at)engelschall(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [BUGS] Patch to allow C extension modules to initialize/finish
Date: 2006-08-05 01:38:49
Message-ID: 87wt9ootau.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Gregory Stark <gsstark(at)mit(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2006-08-05 02:05:52 Re: [BUGS] Patch to allow C extension modules to initialize/finish
Previous Message Tom Lane 2006-08-05 01:10:04 Re: [BUGS] Patch to allow C extension modules to initialize/finish

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-08-05 01:58:08 Re: 8.2 features status
Previous Message Tom Lane 2006-08-05 01:34:46 Re: 8.2 features status