Merge lp:~syleam/openobject-server/trunk-dont-use-with-oids into lp:openobject-server

Proposed by Christophe CHAUVET
Status: Merged
Merged at revision: 4646
Proposed branch: lp:~syleam/openobject-server/trunk-dont-use-with-oids
Merge into: lp:openobject-server
Diff against target: 21 lines (+2/-2)
1 file modified
openerp/osv/orm.py (+2/-2)
To merge this branch: bzr merge lp:~syleam/openobject-server/trunk-dont-use-with-oids
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Approve
Christophe CHAUVET (community) Needs Resubmitting
Review via email: mp+138503@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Looks ok, but why not drop the "WITH[OUT] OIDS" clause directly? It's deprecated and the default is off since PostgreSQL 8.1 [*] and OpenERP requires 8.3.

Also it's best to avoid any kind of whitespace alteration on lines that are not modified by the patch, because it pollutes the version history. If you really really want to change whitespace you should do it in a separate commit at least (but it's better to simply avoid it). We ask all our developers to turn all kind of "at-save" code formatting triggers, because of that ;-)

Thanks for the patch!

[*] http://www.postgresql.org/docs/8.4/static/runtime-config-compatible.html#GUC-DEFAULT-WITH-OIDS

review: Needs Fixing
4645. By Christophe CHAUVET

[IMP] Remove completly the OIDS, cause WITHOUT OIDS is activate by default

Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Hi Olivier

Thanks for your reply. As you answer suggest i remove the WITHOUT OIDS

For the whitespace alteration, it generate by vim-openerp extension, sorry for the noise ;)

[1] https://code.launchpad.net/~vim-openerp-team/vim-openerp/devel

Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

As suggest i remove the terms WITH[OUT] OIDS

Regards,

review: Needs Resubmitting
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Excellent, thanks! And having the MP branch pre-tested and green on runbot makes the job even easier! :-D
Merged!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/osv/orm.py'
2--- openerp/osv/orm.py 2012-12-05 08:28:40 +0000
3+++ openerp/osv/orm.py 2012-12-07 16:23:26 +0000
4@@ -3234,7 +3234,7 @@
5
6
7 def _create_table(self, cr):
8- cr.execute('CREATE TABLE "%s" (id SERIAL NOT NULL, PRIMARY KEY(id)) WITHOUT OIDS' % (self._table,))
9+ cr.execute('CREATE TABLE "%s" (id SERIAL NOT NULL, PRIMARY KEY(id))' % (self._table,))
10 cr.execute(("COMMENT ON TABLE \"%s\" IS %%s" % self._table), (self._description,))
11 _schema.debug("Table '%s': created", self._table)
12
13@@ -3318,7 +3318,7 @@
14 raise except_orm('Programming Error', ('Many2Many destination model does not exist: `%s`') % (f._obj,))
15 dest_model = self.pool.get(f._obj)
16 ref = dest_model._table
17- cr.execute('CREATE TABLE "%s" ("%s" INTEGER NOT NULL, "%s" INTEGER NOT NULL, UNIQUE("%s","%s")) WITH OIDS' % (m2m_tbl, col1, col2, col1, col2))
18+ cr.execute('CREATE TABLE "%s" ("%s" INTEGER NOT NULL, "%s" INTEGER NOT NULL, UNIQUE("%s","%s"))' % (m2m_tbl, col1, col2, col1, col2))
19 # create foreign key references with ondelete=cascade, unless the targets are SQL views
20 cr.execute("SELECT relkind FROM pg_class WHERE relkind IN ('v') AND relname=%s", (ref,))
21 if not cr.fetchall():