[Sqlalchemy-tickets] [sqlalchemy] #1778: (regression in 0.6 with postgresql) insert in a table with
Brought to you by:
zzzeek
From: sqlalchemy <mi...@zz...> - 2010-04-22 14:43:56
|
#1778: (regression in 0.6 with postgresql) insert in a table with composite primary key ----------------------+----------------------------------------------------- Reporter: guest | Owner: zzzeek Type: defect | Status: new Priority: high | Milestone: 0.6.1 Component: postgres | Severity: no triage selected yet Keywords: | Status_field: awaiting triage ----------------------+----------------------------------------------------- * PostgreSQL 8.3 * SQLAlchemy 0.6.0 * psycopg2 2.2.0 I try to insert an object in a table having a composite PK.[[BR]] Both using SQL and ORM, it fails with SA 0.6.0.[[BR]] But __it works with 0.5.8__ (same versions of psycopg2 and postgresql). '''Traceback:''' {{{ Traceback (most recent call last): File "composite.py", line 59, in <module> main() File "composite.py", line 51, in main sa_session.commit() File "./lib/python2.5/site-packages/sqlalchemy/orm/session.py", line 655, in commit self.transaction.commit() File "./lib/python2.5/site-packages/sqlalchemy/orm/session.py", line 368, in commit self._prepare_impl() File "./lib/python2.5/site-packages/sqlalchemy/orm/session.py", line 352, in _prepare_impl self.session.flush() File "./lib/python2.5/site-packages/sqlalchemy/orm/session.py", line 1348, in flush self._flush(objects) File "./lib/python2.5/site-packages/sqlalchemy/orm/session.py", line 1429, in _flush flush_context.execute() File "./lib/python2.5/site-packages/sqlalchemy/orm/unitofwork.py", line 293, in execute rec.execute(self) File "./lib/python2.5/site-packages/sqlalchemy/orm/unitofwork.py", line 426, in execute uow File "./lib/python2.5/site-packages/sqlalchemy/orm/mapper.py", line 1559, in _save_obj c = connection.execute(statement.values(value_params), params) File "./lib/python2.5/site-packages/sqlalchemy/engine/base.py", line 1109, in execute return Connection.executors[c](self, object, multiparams, params) File "./lib/python2.5/site-packages/sqlalchemy/engine/base.py", line 1186, in _execute_clauseelement return self.__execute_context(context) File "./lib/python2.5/site-packages/sqlalchemy/engine/base.py", line 1225, in __execute_context r = context.get_result_proxy()._autoclose() File "./lib/python2.5/site-packages/sqlalchemy/engine/base.py", line 2065, in _autoclose self.context._fetch_implicit_returning(self) File "./lib/python2.5/site-packages/sqlalchemy/engine/default.py", line 580, in _fetch_implicit_returning for c, v in zip(table.primary_key, self._inserted_primary_key) File "./lib/python2.5/site-packages/sqlalchemy/engine/base.py", line 1751, in __getitem__ processor, index = self._parent._key_fallback(key) File "./lib/python2.5/site-packages/sqlalchemy/engine/base.py", line 1928, in _key_fallback "Could not locate column in row for column '%s'" % key) sqlalchemy.exc.NoSuchColumnError: "Could not locate column in row for column 'publi_link.link_rev'" }}} '''Table:''' {{{ #!sql CREATE TABLE publi_link ( link_id SERIAL, link_rev SMALLINT, article_id INTEGER, url VARCHAR(2000), PRIMARY KEY (link_id, link_rev) ); }}} -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/1778> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |