Re: Extensions User Design - Mailing list pgsql-hackers

From Richard Huxton
Subject Re: Extensions User Design
Date
Msg-id 4A68405A.8080803@archonet.com
Whole thread Raw
In response to Re: Extensions User Design  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Extensions User Design
List pgsql-hackers
Peter Eisentraut wrote:
> Instead of installing an "extension", that is, say, a collection> of types and functions provided by a third-party
source,I would> like to have a mechanism to deploy my own actual database> application code.
 

> On the matter of schemas, I suggest that we consider two ideas that have 
> helped RPM in its early days, when everyone had their own very specific ideas 
> about what should be installed where:
> 
> - file system hierarchy standard
> - relocations

Of course if you have IMPORT from an extension, it's down to the DBA:

INSTALL chinese_calendar;
IMPORT FROM chinese_calendar SECTION (default) INTO SCHEMA pg_extension;
IMPORT FROM chinese_calendar SECTION (year_names) INTO SCHEMA lookups;

INSTALL peter_e_app;
IMPORT FROM peter_e_app SECTION (all) INTO SCHEMA public;

Of course this means two things:
1. Every "extension" has to have its own schema mappings.
2. The application view of the database is a sort of "default extension"

Pros:
- Namespace collisions begone!
- Anything to help extension upgrades could be re-used for applications 
(and vice-versa)
- Some stuff isn't visible outside the extension *at all*
- You can separate extension installation from usage (good for 
multi-user setups).

Cons:
- Extra layer of indirection (find my namespace => namespace lookup => 
object)
- Extensions need to list what they export in what sections
- More code required

--   Richard Huxton  Archonet Ltd


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Extensions User Design
Next
From: Robert Haas
Date:
Subject: Re: extension facility (was: revised hstore patch)