summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/postgres.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-10-18 18:14:06 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-10-18 18:14:06 +0000
commita20222fc22059df30b09b49621a784b54919613a (patch)
tree99d99b2516fa81520ae1878e31e638f188ccc40f /lib/sqlalchemy/databases/postgres.py
parent223bd3688dfd01f9dff973cbf9b3d92f39df4c21 (diff)
downloadsqlalchemy-a20222fc22059df30b09b49621a784b54919613a.tar.gz
- 0.5.0rc3, doh
- The internal notion of an "OID" or "ROWID" column has been removed. It's basically not used by any dialect, and the possibility of its usage with psycopg2's cursor.lastrowid is basically gone now that INSERT..RETURNING is available. - Removed "default_order_by()" method on all FromClause objects. - profile/compile/select test is 8 function calls over on buildbot 2.4 for some reason, will adjust after checking the results of this commit
Diffstat (limited to 'lib/sqlalchemy/databases/postgres.py')
-rw-r--r--lib/sqlalchemy/databases/postgres.py22
1 files changed, 1 insertions, 21 deletions
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py
index aeed41078..1c410af53 100644
--- a/lib/sqlalchemy/databases/postgres.py
+++ b/lib/sqlalchemy/databases/postgres.py
@@ -292,19 +292,6 @@ class PGExecutionContext(default.DefaultExecutionContext):
else:
return base.ResultProxy(self)
- def post_exec(self):
- if self.compiled.isinsert and self.last_inserted_ids is None:
- if not self.dialect.use_oids:
- pass
- # will raise invalid error when they go to get them
- else:
- table = self.compiled.statement.table
- if self.cursor.lastrowid is not None and table is not None and len(table.primary_key):
- s = sql.select(table.primary_key, table.oid_column == self.cursor.lastrowid)
- row = self.connection.execute(s).fetchone()
- self._last_inserted_ids = [v for v in row]
- super(PGExecutionContext, self).post_exec()
-
class PGDialect(default.DefaultDialect):
name = 'postgres'
supports_alter = True
@@ -316,9 +303,8 @@ class PGDialect(default.DefaultDialect):
supports_pk_autoincrement = False
default_paramstyle = 'pyformat'
- def __init__(self, use_oids=False, server_side_cursors=False, **kwargs):
+ def __init__(self, server_side_cursors=False, **kwargs):
default.DefaultDialect.__init__(self, **kwargs)
- self.use_oids = use_oids
self.server_side_cursors = server_side_cursors
def dbapi(cls):
@@ -382,12 +368,6 @@ class PGDialect(default.DefaultDialect):
else:
return self.context.last_inserted_ids
- def oid_column_name(self, column):
- if self.use_oids:
- return "oid"
- else:
- return None
-
def has_table(self, connection, table_name, schema=None):
# seems like case gets folded in pg_class...
if schema is None: