From a20222fc22059df30b09b49621a784b54919613a Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 18 Oct 2008 18:14:06 +0000 Subject: - 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 --- lib/sqlalchemy/databases/postgres.py | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'lib/sqlalchemy/databases/postgres.py') 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: -- cgit v1.2.1