Re: Alternative to serial primary key

Поиск
Список
Период
Сортировка
От Aaron Bono
Тема Re: Alternative to serial primary key
Дата
Msg-id bf05e51c0607060902vdd8d993u470c128abf127d3d@mail.gmail.com
обсуждение исходный текст
Ответ на Alternative to serial primary key  ("David Clarke" <pigwin32@gmail.com>)
Ответы Re: Alternative to serial primary key
Список pgsql-sql
On 7/6/06, David Clarke <pigwin32@gmail.com> wrote:
I posted a couple of weeks back a question regarding the use of a 100
char column as a primary key and the responses uniformily advised the
use of a serial column. My concern is that the key is effectively
abstract and I want to use the column as a foreign key in other
tables.

I have a simple question... why do you want to use the column as a foreign key in other tables?  If you use the serial column then all you need is a simple join to get the 100 char column out in your query.  If you need to make things simpler, just create a view that does the join for you.

Either there is some requirement here that I am not aware of or it sounds like you may be trying to use a sledge hammer on a nail.

-Aaron

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

Предыдущее
От: "Aaron Bono"
Дата:
Сообщение: Re: week ending
Следующее
От:
Дата:
Сообщение: Re: Alternative to serial primary key