[postgis-users] Schemas in 7.3

Paul Ramsey pramsey at refractions.net
Thu Feb 6 12:35:55 PST 2003

7.3 is starting to stabilize now (7.3.2 was just released) so more and 
more people are going to be using it, and by extension using PostGIS 
with it.

One of the new 7.3 features is support for "schemas". Schemas 
essentially partition a single database into multiple namespaces, which 
can have different priviledge levels. So it becomes possible to have 
multiple "different" databases in the same simple database. The reason 
to do this is so that "related" applications can share data while 
keeping their application-specific data separate.

So the "tax collection" branch can have all their tax table, but have 
access to a general "citizen registry" table in another schema which 
they have only read access to.

Basically schemas are a means of managing complex relationships between 
different users and user groups. Often PgSQL administrators would solve 
the problem by partitioning different groups into different databases. 
But what if the groups wanted to share data? It is not possible ot join 
tables across databaes. Schemas are the answer.

Right now, PostGIS gets loaded into the schema which psql has connected 
to. If you are loading as the 'postgres' user, then your PostGIS support 
functions and objects will get loaded into the system schema. If you are 
loading as another user, then they'll end up somewhere else (like your 
personal schema, for example). So, the question is: where should PostGIS 
support get loaded? Should we enforce any particular loading location, 
or just "let it all hang out" like we are doing now? The trouble with 
the current way of doing things is that it is possible for people to 
mess up their install in subtle ways, by loading PostGIS into some 
non-system schema which ordinary users have no (or partial) access to.

Food for healthy thoughts,

      | Paul Ramsey
      | Refractions Research
      | Email: pramsey at refractions.net
      | Phone: (250) 885-0632

More information about the postgis-users mailing list