Issue #28 resolved

make oid/rowid functionality optional for Postgres

Mike Bayer
repo owner created an issue

postgres has disabled oids by default as of 8.1 (rowids in sqlalchemy). make all useage of rowids optional, and have postgres by default not use rowids at all. SERIAL columns should use the default sequence <table>_<column>_seq to generate primary keys.

we probably want to make a special sequence internal to postgres that doesnt conflict with an existing "optional" sequence and modify sqlengine's _process_defaults() to give more control to the subclass in running a column's default generators.

Comments (2)

  1. Mike Bayer reporter

    the whole 'rowid' concept only gets enabled for engines if you specify "default_ordering" to create_engine(). mappers/relations dont do any ordering by default unless 'rowid' column is present. engine determines 'rowid' from table primary key or just the first column in the table if "rowid_column_name" is not defined for that engine. postgres doesnt define "rowid_column_name" unless you send the "use_oids" option to the postgres engine. postgres engine now always calls sequences explicitly, and determines its name on the fly if SERIAL is defined and no Sequence object was given. unittests given more options to differentiate between engines that use sequences/dont use sequences.

    changesets changeset:763 changeset:764 changeset:765

  2. Log in to comment