[Bucardo-general] Status on Multi-Column Primary Key Support
Jon Jensen
jon at endpoint.com
Sun Oct 28 01:24:25 UTC 2007
On Fri, 26 Oct 2007, Ben Allen wrote:
>> In reality, keys with more than 2 primary keys are unlikely, so I'm not
>> convinced that we need to be so flexible as to hold any number of keys.
>> Perhaps three would be sufficient?
>
> In most cases I would think three would be sufficient. For my current
> project, the max I have is a three column primary keys and only in one
> table. Although, I would hate to have someone run into an imposed limit.
> Depending on how much difficulty adding 'unlimited' (significantly high
> enough, i.e. 10-20+) number of primary keys would be compared to a
> limited number, I would say lean towards goal of unlimited primary keys.
Though it seems a little ridiculous, I too would lean towards unlimited
keys. 1 more than whatever maximum you choose will always seem reasonable
to the person who needs it. :)
>> 2. goat.pkey = 'id1|id2'; goat.pkeytype = 'int|text';
>
> Just make sure you use a character for the separator that can never be
> in a column name or data-type (I guess thats probably going to be a
> little hard, "|" will likely work and looks logical). Would 2 be any
> harder to validate on insert/update then 3? Number 1 is ugly and harder
> to expand in the future if the need arises. My vote is for number 2.
Yeah, I think #2 is the best of the lot as well. None of them are
"satisfying" exactly, but that's life.
By the way, will #2 make working with column names that need quoting any
harder? Such as mixed case names, or names with spaces? Does Bucardo even
work with such names right now?
Jon
--
Jon Jensen
End Point Corporation
http://www.endpoint.com/
More information about the Bucardo-general
mailing list