Re: PostgreSQL Developer Best Practices

Поиск
Список
Период
Сортировка
От Gavin Flower
Тема Re: PostgreSQL Developer Best Practices
Дата
Msg-id 55DCD32F.6070301@archidevsys.co.nz
обсуждение исходный текст
Ответ на Re: PostgreSQL Developer Best Practices  (Melvin Davidson <melvin6925@gmail.com>)
Ответы Re: PostgreSQL Developer Best Practices
Список pgsql-general
On 26/08/15 03:40, Melvin Davidson wrote:
[...]
> IOW: If we have an account table, then the account_id or account_no
>      would be the primary key. There is no need to have a separate
> serial id as the primary key.
[...]

Account numbers are externally generated, and may potentially change.
Management might suddenly decide that they want to start using the year
the account started as the first 4 digits, or that the branch code
should be reflected in it, or something else.  The database should be
protected from these arbitrary changes.  Hence the account_no is not a
good candidate for a primary key.


Cheers,
Gavin


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

Предыдущее
От: Joseph Kregloh
Дата:
Сообщение: Re: Why does splitting $PGDATA and xlog yield a performance benefit?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: PostgreSQL Developer Best Practices