seems to me, reading the Column docstring, autoincrement is True by default for any part of a primarykey. i'll try to switch it off... And seems this must apply to any column that is actualy a foregnkey, referencing something else - autoincr must be turned off.
On Tuesday 13 May 2008 10:48:23 Eric Ongerth wrote: > So part of the problem is postgresql is autoincrementing where you > do not want it to do so? I thought postgresql only autoincrements > where your column is of type 'serial'. Is that not true? Or if > so, you could use type 'integer' instead of 'serial'. There is > also the possibility that the combination of column type 'integer' > and 'nullable=False" is handled as identical to 'serial', i.e. > autoincrement. I think I've seen that before but I'm not sure. > > On May 12, 2:57 pm, [EMAIL PROTECTED] wrote: > > hi. > > i have a sort-of multicolumn m2m association table, where the > > primary key is composed of all the links. At least 1 link > > (actualy, 2) is always present, but never all. so i am defining > > all of those columns with primary_key=True, nullable=True. > > which is fine in sqlite, but doesnot work in postgres - it > > autoincrements those columns without value. > > > > how can i fix this? > > would a default_value=0 - or something - work? > > > > (now as i look at it, at least as declaration, the whole primary > > key seems nullable - is this wrong?) > > > > ciao > > svil > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---