[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Installing LedgerSMB into a schema?



On Mon, 2006-11-06 at 16:09 -0600, Charley Tiggs wrote:
> I should have been more explicit with regards to my question.  I
> already 
> have a current application that has a set of tables.  The tables for 
> that application are installed in the public schema.  I'm wanting to 
> install the tables for LedgerSMB into a separate schema that would 
> provide logical separation of the tables instead of creating a whole
> new 
> database.  I'd like to do this for a number of reasons, the biggest 
> being that I have to store the data for the products in a manner that 
> LedgerSMB doesn't seem to allow at the moment.  So, I create the
> product 
> in the clients existing app and then push that data to LSMB in a
> format 
> that LSMB will accept.

My though is very similar to Chris's but here it is:

CREATE SCHEMA ledgersmb;
CREATE USER lsmb_mycompany WITH NOCREATEDB NOCREATEUSER;
ALTER USER lsmb_mycompany SET search_path TO '$user, ledgersmb, public';

use admin.pl to create the dataset using your existing DB and the new
user lsmb_mycompany. PostgreSQL should place the LedgerSMB tables in the
ledgersmb schema because it is the first schema in the users search
path.

In fact I bet Chris's idea would work without altering the Pg-*.sql
files because new unqualified tables are created in the first schema
listed in the search path.

-- 
Tony Fraser
..hidden..
Sybaspace Internet Solutions                        System Administrator
phone: (250) 246-5368                                fax: (250) 246-5398