diff options
| -rw-r--r-- | doc/build/content/dbengine.txt | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/databases/postgres.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/doc/build/content/dbengine.txt b/doc/build/content/dbengine.txt index a83da7310..e71c44fb2 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 b6917c035..50d67ad56 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'): |
