SQL question

Antoine Nguyen tonio at ngyn.org
Thu Jul 28 18:48:55 CEST 2011

Le 28/07/2011 18:02, Giampaolo Tomassoni a écrit :
>> By the way, I didn't notice the 'quarantine' table was using an
>> explicit
>> composite primary key (between 'mail_id' and 'chunk_ind'). I really
>> don't know how to make it work with django's orm... It smells like I'm
>> going to rollback this work and finally wait for django to support
>> composite keys.
>> Anybody here who has already try to achieve such a thing? :-)
> Change that primary key to an unique index, then create a new auto-increment
> column and set it as the primary key.
> There is no (evident?) reason this shouldn't work with both django and
> amavis...
Yes it is one solution.

I've finally found another solution that looks like the one you 
describe. It seems using the "unique_together" Meta option available for 
models does the trick. Combining this with a fake primary key for models 
that need one should fixed all the issues I encounter.
> Besides, django is not the only ORM disliking composite primaries...
> Have a look at the following, from the Hibernate user forum:
> 	https://forum.hibernate.org/viewtopic.php?f=1&t=964043
> Regards,
> Giampaolo
I didn't know it was a common issue between ORMs.


More information about the amavis-users mailing list