"Tom Dunstan" <pgsql@tomd.cc> writes:
> - I'd like to add pg_depend entries for stuff installed by the module
> on the pd_module entry, so that you can't drop stuff required by the
> module without uninstalling the module itself. There would have to be
> either a function or more syntax to allow a script to do that, or some
> sort of module descriptor that let the backend do it itself.
>
> - Once the issue of loading a dll from inside the module's directory
> is done, I'd like to look for an e.g. module_install() function inside
> there, and execute that rather than the install.sql if found. Ditto
> for uninstall.
I wonder if there's much of a use case for any statements aside from CREATE
statements. If we restrict it to CREATE statements we could hack things to
create pg_depend entries automatically. In which case we wouldn't need an
uninstall script at all.
The hacks to do this seem pretty dirty but on the other hand the idea of
having modules consist of a bunch of objects rather than arbitrary SQL
actually seems cleaner and more robust.
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's RemoteDBA services!