Re: INSERT ... ON CONFLICT DO UPDATE

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: INSERT ... ON CONFLICT DO UPDATE
Дата
Msg-id f6b5387a-f526-4511-8b63-506910578fc6@mm
обсуждение исходный текст
Ответ на Re: INSERT ... ON CONFLICT DO UPDATE  (Melvin Davidson <melvin6925@gmail.com>)
Ответы Re: INSERT ... ON CONFLICT DO UPDATE  (Francisco Olarte <folarte@peoplecall.com>)
Список pgsql-general
    Melvin Davidson wrote:

> Aside from Tom Lane's comments, it seems to me you are reinventing the wheel
> by generating random values for keys. Why not just use UUID
> http://www.postgresql.org/docs/9.5/static/datatype-uuid.html
> or serial
> http://www.postgresql.org/docs/9.5/static/datatype-numeric.html#DATATYPE-SERIAL?
> Wouldn't that simplify things by insuring uniqueness?

UUIDs are 36 characters wide; it's too boring and error-prone
for a person to type this on a keyboard or spell it over the phone
to an operator.

For SERIAL, it's too obvious to guess what is the next one,
so malicious people could claim access codes or vouchers
they don't own.

The constraint is that such codes must be reasonably short, but
someone who tries to make up one must have a near-zero chance
of guessing one that actually exists.

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @ManitouMail


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

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: INSERT ... ON CONFLICT DO UPDATE
Следующее
От: Joseph Kregloh
Дата:
Сообщение: Re: Upgrade postgres cluster on FreeBSD using pg_upgrade