Re: IS it a good practice to use SERIAL as Primary Key?

Поиск
Список
Период
Сортировка
От Joshua D. Drake
Тема Re: IS it a good practice to use SERIAL as Primary Key?
Дата
Msg-id 1164672174.6398.35.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: IS it a good practice to use SERIAL as Primary Key?  (John McCawley <nospam@hardgeus.com>)
Ответы Re: IS it a good practice to use SERIAL as Primary Key?  (Scott Ribe <scott_ribe@killerbytes.com>)
Re: IS it a good practice to use SERIAL as Primary Key?  (Michael Glaesemann <grzm@seespotcode.net>)
Список pgsql-general
On Mon, 2006-11-27 at 17:31 -0600, John McCawley wrote:
> I promise I'm not trying to be a pain in the butt ;)  Do you then use
> your serial id as your foreign key in other tables, or the
> firstname/lastname primary key?

Now that is a good question. I would use the id, but that is not
technically proper :).

Joshua D. Drake


>
> Joshua D. Drake wrote:
>
> >users
> >=====
> >id serial unique,
> >first_name text,
> >last_name text,
> >primary key (first_name,last_name)
> >
> >Yes there are problems with the above, namely you will likely have more
> >than one joshua drake.
> >
> >Sincerely,
> >
> >Joshua D. Drake
> >
> >
> >>
> >>
>
--

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate




В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: IS it a good practice to use SERIAL as Primary Key?
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: IS it a good practice to use SERIAL as Primary Key?