Re: Create on insert a unique random number

Поиск
Список
Период
Сортировка
От D'Arcy J.M. Cain
Тема Re: Create on insert a unique random number
Дата
Msg-id 20080318153613.364cf08d.darcy@druid.net
обсуждение исходный текст
Ответ на Re: Create on insert a unique random number  (Steve Midgley <public@misuse.org>)
Ответы Re: Create on insert a unique random number
Список pgsql-sql
On Tue, 18 Mar 2008 12:23:35 -0700
Steve Midgley <public@misuse.org> wrote:
> 1) Create a second field (as someone recommend on this list) that is an 
> MD5 of your primary key. Use that as your "accessor" index from the web 

I strongly disagree for three reasons.  First, if you are going to
generate a key then don't store it.  Just generate it every time.
Second, don't generate it based on a known field.  You may think that
it is secure but what if you private key is compromised?  Do you then
change everyone's security code?  Third, what if one person's
code is compromised?  If it is based on a calculation then you
can't change that one person's security code.

Generate a random number and store that.  You will be much happier when
something goes wrong and something always goes wrong.

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


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

Предыдущее
От: "D'Arcy J.M. Cain"
Дата:
Сообщение: Re: Create on insert a unique random number
Следующее
От: "Yusnel Rojas García"
Дата:
Сообщение: pg_dump using SQL