Re: what about _PG_fini

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: what about _PG_fini
Date: 2009-12-23 21:26:47
Message-ID: 14137.1261603607@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?ISO-8859-1?Q?C=E9dric_Villemain?= <cedric(dot)villemain(dot)debian(at)gmail(dot)com> writes:
> I wonder what is the future of "_PG_fini", documentation say at [1]:
> "Note that _PG_fini will only be called during an unload of the file,
> not during process termination. (Presently, unloads are disabled and
> will never occur, but this may change in the future.)"

What we'd need to work out before (re)enabling _PG_fini is some
consistent rules for allowing multiple modules to get into *and out of*
the same hook pointers. The current coding methods are very
load-order-dependent, and that would have to be fixed somehow.

> 1. do we want a _PG_fini which is call on server stop ?
> 2. what's actually the best way to execute some code when server stop,
> if one have ideas ... ?

In any case, _PG_fini would have approximately nothing to do with "code
to be executed on server stop". It would happen at session end,
typically.

Personally I'd suggest putting whatever you have in mind into your
service start/stop scripts.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-12-23 21:34:04 Re: Removing pg_migrator limitations
Previous Message Greg Stark 2009-12-23 21:23:44 Re: Removing pg_migrator limitations