summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/postgres.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-01-14 20:21:36 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-01-14 20:21:36 +0000
commit437f1ce670e84964dc701488ac09af565ba807f7 (patch)
treee6a92d2850af4695d3651e29cd8b72cc10872c26 /lib/sqlalchemy/databases/postgres.py
parent5b4871f4364c7b93de010097aa8f4008f69bddd4 (diff)
downloadsqlalchemy-437f1ce670e84964dc701488ac09af565ba807f7.tar.gz
- postgres cursor option is now server_side_cursors=False; some users get bad results using them
so theyre off by default - type system slightly modified to support TypeDecorators that can be overridden by the dialect - added an NVarchar type to mssql (produces NVARCHAR), also MSUnicode which provides Unicode-translation for the NVarchar regardless of dialect convert_unicode setting.
Diffstat (limited to 'lib/sqlalchemy/databases/postgres.py')
-rw-r--r--lib/sqlalchemy/databases/postgres.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py
index 79db8716c..94519a5ac 100644
--- a/lib/sqlalchemy/databases/postgres.py
+++ b/lib/sqlalchemy/databases/postgres.py
@@ -207,9 +207,9 @@ class PGExecutionContext(default.DefaultExecutionContext):
self._last_inserted_ids = [v for v in row]
class PGDialect(ansisql.ANSIDialect):
- def __init__(self, module=None, use_oids=False, use_information_schema=False, client_side_cursors=False, **params):
+ def __init__(self, module=None, use_oids=False, use_information_schema=False, server_side_cursors=False, **params):
self.use_oids = use_oids
- self.client_side_cursors = client_side_cursors
+ self.server_side_cursors = server_side_cursors
if module is None:
#if psycopg is None:
# raise exceptions.ArgumentError("Couldnt locate psycopg1 or psycopg2: specify postgres module argument")
@@ -241,13 +241,12 @@ class PGDialect(ansisql.ANSIDialect):
return ([], opts)
def create_cursor(self, connection):
- if self.client_side_cursors:
- return connection.cursor()
- else:
+ if self.server_side_cursors:
# use server-side cursors:
# http://lists.initd.org/pipermail/psycopg/2007-January/005251.html
return connection.cursor('x')
-
+ else:
+ return connection.cursor()
def create_execution_context(self):
return PGExecutionContext(self)