Re: [Sqlalchemy-users] postgres SERIAL

2006-03-01 Thread Robert Leftwich
Michael Bayer wrote: i suppose the advantage over a separate primary key / foreign key in the child table is that it enforces a one-to-one mapping ? Yep - it's one of the things I really like in SA c.f. SQLObject which forced you to use internal primary keys (or at least it did, haven't che

Re: [Sqlalchemy-users] postgres SERIAL

2006-03-01 Thread Michael Bayer
i suppose the advantage over a separate primary key / foreign key in the child table is that it enforces a one-to-one mapping ? On Mar 1, 2006, at 7:54 PM, Robert Leftwich wrote: Michael Bayer wrote: just curious, why would a primary key column want to be a foreign key as well ? seems a

Re: [Sqlalchemy-users] postgres SERIAL

2006-03-01 Thread Robert Leftwich
Michael Bayer wrote: just curious, why would a primary key column want to be a foreign key as well ? seems a little denormalized to me. Composite/bridge entities in m:n relationships. Robert --- This SF.Net email is sponsored by xPML, a g

Re: [Sqlalchemy-users] postgres SERIAL

2006-03-01 Thread Michael Bayer
just curious, why would a primary key column want to be a foreign key as well ? seems a little denormalized to me. On Mar 1, 2006, at 7:36 PM, Robert Leftwich wrote: Marko Mikulicic wrote: if column.primary_key and isinstance(column.type, types.Integer) and (column.default is None or (isi

Re: [Sqlalchemy-users] postgres SERIAL

2006-03-01 Thread Robert Leftwich
Marko Mikulicic wrote: if column.primary_key and isinstance(column.type, types.Integer) and (column.default is None or (isinstance(column.default, schema.Sequence) and column.default.optional)): colspec += " SERIAL" In addition, this has the same issue as autoincrement in mysql, i.e. it

Re: [Sqlalchemy-users] postgres SERIAL

2006-03-01 Thread Michael Bayer
"optional" is a funny little flag i should change the name of, it essentially means "use this Sequence only if the database *requires* an explicit sequence to be created", which at the moment is only Oracle. so "optional" should really be called "only_if_required" or something like that.