Derek Atkins wrote:
> Mark Johnson <[EMAIL PROTECTED]> writes:
>
>   
>> Phil Longstaff wrote:
>>     
>>> The slot_id is used to provide a unique primary key.  I don't know if it 
>>> would work to have the slots table have *no* key, but have an index on 
>>> the obj_guid field.  The obj_guid field can't be the primary key because 
>>> I believe a primary key needs to be unique.  Mark?
>>>
>>>   
>>>       
>> Yes, a primary key does have to be unique.  I can't think of any 
>> requirement that a table have a primary key though.  It is generally 
>> good practice.  You could have an index on the guid field.
>>     
>
> I think the question was more:  Does every table have to HAVE
> a primary key?  Yes, the primary key must be unique, but what
> if a table has no primary key?  Is that still okay?
>
> -derek
>   
I saw it as 2 questions: Does a primary key have to be unique?
Yes

Does a table require a primary key?
No

Mark


_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to