-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Why does trac/db/postgres_backend.py reset the search_path if you
tell it to use a schema? I can see why this might be desired by some.
How can it be made an option?
Or can we arrange some hack where the first item (,-seperated) in the
schema= is the actual schema to use, but the entire string is used to
set the search_path?
navajo-[/trac/src/trac] mcr 1070 %svn diff
Index: trac/db/postgres_backend.py
===================================================================
- --- trac/db/postgres_backend.py (revision 5851)
+++ trac/db/postgres_backend.py (working copy)
@@ -66,7 +66,7 @@
cursor = cnx.cursor()
if cnx.schema:
cursor.execute('CREATE SCHEMA "%s"' % cnx.schema)
- - cursor.execute('SET search_path TO %s', (cnx.schema,))
+ cursor.execute('SET search_path TO %s,public', (cnx.schema,))
from trac.db_default import schema
for table in schema:
for stmt in self.to_sql(table):
@@ -139,11 +139,13 @@
PgSQL.noPostgresCursor = 1
cnx = PgSQL.connect('', user, password, host, path, port,
client_encoding='utf-8', unicode_results=True)
+ #f = open("/var/tmp/thinctrac.txt","a")
+ #cnx.trace(f)
try:
self.schema = None
if 'schema' in params:
self.schema = params['schema']
- - cnx.cursor().execute('SET search_path TO %s', (self.schema,))
+ cnx.cursor().execute('SET search_path TO %s,public',
(self.schema,))
except PGSchemaError:
cnx.rollback()
ConnectionWrapper.__init__(self, cnx)
@@ -171,6 +173,6 @@
self.cnx.rollback()
if self.schema:
try:
- - self.cnx.cursor().execute("SET search_path TO %s",
(self.schema,))
+ self.cnx.cursor().execute("SET search_path TO %s,public",
(self.schema,))
except PGSchemaError:
self.cnx.rollback()
- --
[EMAIL PROTECTED] / [EMAIL PROTECTED]
XDS Inc, Ottawa, ON
Personal: http://www.sandelman.ca/mcr/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Finger me for keys
iQEVAwUBRroi74CLcPvd0N1lAQIjiQf9HuJvt62CfToUYaCQs+yyoqHCea9N3W83
hSOTtXYgtNfI4xsWY5l4QGJVKuqQ6/SHA1UYf4kCIwyO6wgwJPIaNAIhkhJDhchW
Qh4FYXuTxU3/7gas3C7vOAAO5/aow6vU86uGDEJTlu8e9PXj7u1cbeY1PnNXZ1Ty
l53qPgMckQB1a8e3dzlJoEh9zsOQqH8G21NVsPcdRR7gTCVVg27bn+IPZd+w3oJe
4xME/IDus2eWJpbM6PExq5Wq0gKcOO3cT36bduVzWwczUGCeWM60L3KiXpD26bVs
mYxSShBp8koHIRzJBV8NbgAS0UtlEijIwmHdkMmW6n1vcds4nYq23w==
=pYd/
-----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---