Re: [GENERAL] using ID as a key - Mailing list pgsql-general

From Ed Loehr
Subject Re: [GENERAL] using ID as a key
Date
Msg-id 389B5305.F1A5E21C@austin.rr.com
Whole thread Raw
In response to Re: [GENERAL] using ID as a key  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [GENERAL] using ID as a key  (Marc Tardif <admin@wtbwts.com>)
List pgsql-general
Bruce Momjian wrote:
>
> > Marc Tardif wrote:
> > >
> > > I recommend you read Momjian's online book, very informative and provides
> > > all the necessary information about using various kinds of id's:
> > > http://www.postgresql.org/docs/aw_pgsql_book/index.html
> >
> > In glancing at Momjian's stuff on this just now, I noticed the book
> > could leave the first-time reader with the impression that both OIDs
> > and sequences (ie, SERIAL) are viable choices for use as primary keys
> > (unintentionally?).  Sequences and SERIALs are not mentioned until
> > after a long example of how to do primary keys with OIDs.
>
> Don't glance.  Read the whole chapter.  It will be clear.  If people get
> the wrong impression by reading part of the chapter, well, it's their
> fault.

What's clear is this is a really lousy answer to a specific question,
and that you're not too open to feedback on the book.

The answer, as Momjian himself points out in the section right after
the one in which he shows you how to use OIDs as primary keys, is that
OIDs are NOT DUMPED AT BACKUP TIME by default.  That would mean your
newly-dumped database would be corrupt upon creation if you used
OIDs.  Most people wouldn't appreciate that very much.  Alas, he does
mention that you may twiddle this flag to have OIDs
dumped...uh...er...nevermind...that documentation doesn't exist yet.
Give me a break.

The book leads people astray in this regard, Mr. Momjian.  If you'd
want to spend time reading posts from people requesting help in
salvaging databases corrupted by their book-inspired error, rather
than taking a hint on a confusing presentation, that's your choice.

Cheers,
Ed Loehr

pgsql-general by date:

Previous
From: davidb@vectormath.com
Date:
Subject: Re: [GENERAL] using ID as a key
Next
From: Ed Loehr
Date:
Subject: Re: [GENERAL] using ID as a key