Database Tricks

From LaneWiki

Jump to: navigation, search

Contents

Sharing the Database with Other Programs (aka Separate Schema)

L’âne operates in a single schema. By default, PostgreSQL uses the schema named public, but L’âne can easily exist in another schema. Uses of separate schema include:

  • Multiple stores in separate schema for consolidated reporting
  • Training Mode overlay schema (only some db objects exist in the “top” schema)
  • Triggers to keep various datasets in sync (another program, for example)

Best Practice

The best practice is to have a separate, limited access account running the register application. Each person using the back office tools should have a separate account too. To set the default schema search path for user thisperson, use the following SQL:

ALTER USER thisperson SET search_path = myschema,public;

An Alternative

One can also specify the default schema search path in the L’âne config file, $LaneRoot/config/site.pl.

$ENV{'PGOPTIONS'} = '-c search_path=myschema,public';

See Also

System Administration Tasks#Basic DB Maintenace

Personal tools