GDA: empty PostgreSQL table failed workaround

Nathan Buchanan nbinont at gmail.com
Thu Feb 14 13:10:40 EST 2008


On Thu, Feb 14, 2008 at 12:45 PM, Derek Atkins <warlord at mit.edu> wrote:

> Mark Johnson <mrj001 at shaw.ca> 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?


no. The SQL spec does not require a primary key.

Yes, the primary key must be unique, but what
> if a table has no primary key?  Is that still okay?


yes, it is ok, though performance will usually suffer.

Nathan

>
>
> -derek
> --
>       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>       Member, MIT Student Information Processing Board  (SIPB)
>       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>       warlord at MIT.EDU                        PGP key available
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>



-- 
<><><><><><><><><><><><><><><>
"Even if you are on the right track, you'll get run over if you just sit
there" - Will Rogers


More information about the gnucash-devel mailing list