Re: [GENERAL] using ID as a key

From: Ed Loehr <eloehr(at)austin(dot)rr(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Marc Tardif <admin(at)wtbwts(dot)com>, sheila bel <sheilabel(at)hotmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] using ID as a key
Date: 2000-02-04 22:30:29
Message-ID: 389B5305.F1A5E21C@austin.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Drabble 2000-02-04 22:37:08 Re: [GENERAL] using ID as a key
Previous Message davidb 2000-02-04 22:07:34 Re: [GENERAL] using ID as a key