From: Mike Bayer Date: Sat, 3 Jun 2006 17:48:55 +0000 (+0000) Subject: dbengine doc: no support for pg1 X-Git-Tag: rel_0_2_2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd6c2c0c21208dab1ae85c3722f2f454b7bb4db7;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git dbengine doc: no support for pg1 postgres: if module is none, still use pyformat for some unit tests --- diff --git a/doc/build/content/dbengine.txt b/doc/build/content/dbengine.txt index a83da73102..e71c44fb29 100644 --- a/doc/build/content/dbengine.txt +++ b/doc/build/content/dbengine.txt @@ -20,7 +20,7 @@ Underneath the public-facing API of `ComposedSQLEngine`, several components are ### Supported Databases {@name=supported} -Engines exist for SQLite, Postgres, MySQL, and Oracle, using the Pysqlite, Psycopg (1 or 2), MySQLDB, and cx_Oracle modules. There is also preliminary support for MS-SQL using adodbapi or pymssql, as well as Firebird. For each engine, a distinct Python module exists in the `sqlalchemy.databases` package, which provides implementations of some of the objects mentioned in the previous section. +Engines exist for SQLite, Postgres, MySQL, and Oracle, using the Pysqlite, Psycopg2 (Psycopg1 will work to some degree but its typing model is not supported...install Psycopg2!), MySQLDB, and cx_Oracle modules. There is also preliminary support for MS-SQL using adodbapi or pymssql, as well as Firebird. For each engine, a distinct Python module exists in the `sqlalchemy.databases` package, which provides implementations of some of the objects mentioned in the previous section. ### Establishing a Database Engine {@name=establishing} diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index b6917c0358..50d67ad561 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -30,7 +30,6 @@ except: except: psycopg = None - class PGNumeric(sqltypes.Numeric): def get_col_spec(self): return "NUMERIC(%(precision)s, %(length)s)" % {'precision': self.precision, 'length' : self.length} @@ -215,7 +214,10 @@ class PGDialect(ansisql.ANSIDialect): except: self.version = 1 ansisql.ANSIDialect.__init__(self, **params) - + # produce consistent paramstyle even if psycopg2 module not present + if self.module is None: + self.paramstyle = 'pyformat' + def create_connect_args(self, url): opts = url.translate_connect_args(['host', 'database', 'user', 'password', 'port']) if opts.has_key('port'):