Re: transforms - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: transforms
Date
Msg-id 51377BE0.70309@gmx.net
Whole thread Raw
In response to Re: transforms  (Josh Berkus <josh@agliodbs.com>)
Responses Re: transforms  (Josh Berkus <josh@agliodbs.com>)
Re: transforms  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List pgsql-hackers
On 3/5/13 5:52 PM, Josh Berkus wrote:
> More on this: the problem appears to be that the symbols for hstore are
> loaded only if I've just just created the extension in that database:

I see.  This is a problem with any kind of dynamically loadable module
that uses another module.  The other module is only loaded either at
creation time or when a function from it is first used (or if a preload
mechanism is used).

At run time, this will sort itself out, because all the required modules
will be loaded.  The problem is when you create the "glue" extension and
haven't invoked any code from any of the dependent extension in the
session.  Abstractly, the possible solutions are either not to check the
functions when the extension is created (possibly settable by a flag) or
to somehow force a load of all dependent extensions when the new
extension is created.  (I say extension here even though dynamically
loadable modules are attached to functions, which makes this even more
confusing.)

In "normal" programming languages, this is normally addressed by placing
explicit load/require/import statements before you do anything else.
What we are doing here is more like an autoload functionality that some
environments have.  Those have the same problem.




pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Support for REINDEX CONCURRENTLY
Next
From: Merlin Moncure
Date:
Subject: Re: Optimizing pglz compressor