Re: [GENERAL] using ID as a key
От | Ed Loehr |
---|---|
Тема | Re: [GENERAL] using ID as a key |
Дата | |
Msg-id | 389B5305.F1A5E21C@austin.rr.com обсуждение исходный текст |
Ответ на | Re: [GENERAL] using ID as a key (Bruce Momjian <pgman@candle.pha.pa.us>) |
Ответы |
Re: [GENERAL] using ID as a key
|
Список | 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 по дате отправления: