On Feb 16, 2006, at 3:01 AM, Andrus wrote:
I have a multi-company Postgres 8.1 database.
Each company data is stored in a separate schema named company1,
company2, etc
Common data for all companies is stored in a public schema.
At appl startup I need to specify current company using commands in
validateLogin()
cursor = self.connection.getConnection().cursor()
cursor.execute("set search_path to public,company"+companynumber )
Currenty, the only way for this is to change dbPostgresql.py file
directly.
Executing queries in the main cursor is not recommended, since it is
needed for data management, and its internal props get wiped out when
a non-select statement is execute. There is an internal auxiliary
cursor object used by the Dabo Cursor to handle such statements, such
as delete, update, etc. Perhaps I could modify the Dabo Cursor's
execute() method to check to see if the statement begins with
'select', and if not, pass it to its auxiliary cursor for execution.
I could then add a bizobj.execute() method that would essentially be
a pass-through to its Dabo Cursor.
Does this sound like it could work for you?
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users