Re: First feature patch for plperl - draft [PATCH] - Mailing list pgsql-hackers

From Tom Lane
Subject Re: First feature patch for plperl - draft [PATCH]
Date
Msg-id 8950.1259994082@sss.pgh.pa.us
Whole thread Raw
In response to Re: First feature patch for plperl - draft [PATCH]  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: First feature patch for plperl - draft [PATCH]  (Tim Bunce <Tim.Bunce@pobox.com>)
Re: First feature patch for plperl - draft [PATCH]  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
"David E. Wheeler" <david@kineticode.com> writes:
> Tom, what's your objection to Shlib load time being user-visible?

It's not really designed to be user-visible.  Let me give you just
two examples:

* We call a plperl function for the first time in a session, causing
plperl.so to be loaded.  Later the transaction fails and is rolled
back.  If loading plperl.so caused some user-visible things to happen,
should those be rolled back?  If so, how do we get perl to play along?
If not, how do we get postgres to play along?

* We call a plperl function for the first time in a session, causing
plperl.so to be loaded.  This happens in the context of a superuser
calling a non-superuser security definer function, or perhaps vice
versa.  Whose permissions apply to whatever the on_load code tries
to do?  (Hint: every answer is wrong.)

That doesn't even begin to cover the problems with allowing any of
this to happen inside the postmaster.  Recall that the postmaster
does not have any database access.  Furthermore, it is a very long
established reliability principle around here that the postmaster
process should do as little as possible, because every thing that it
does creates another opportunity to have a nonrecoverable failure.
The postmaster can recover if a child crashes, but the other way
round, not so much.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: add more frame types in window functions (ROWS)
Next
From: Daniel Farina
Date:
Subject: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION