Re: Message-ID as unique key?

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Message-ID as unique key?
Дата
Msg-id 873c0j21ti.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: Message-ID as unique key?  (Csaba Nagy <nagy@ecircle-ag.com>)
Список pgsql-general
Csaba Nagy <nagy@ecircle-ag.com> writes:

> So: don't use it as a unique identifier.
>
> On Tue, 2004-10-12 at 17:01, Jerry LeVan wrote:
> >
> > Is the "Message-ID"  header field a globally unique identifer?
> >

[Isn't it awfully confusing to put your answers before the thing you're
responding to?]

Let me suggest a higher-level view of your design decision here.

You shouldn't use the message-id as a unique identifier on the general
principle that it is untrusted network data. You can never trust entities
outside your control to behave the way you expect, even if there's an
authority to back you up. They could be deficient or even hostile.

Even if you don't trust the message-id generated by external users to provide
any particular semantics it can still be useful. You can allow clients to
request a particular message by message-id for example. Just make sure you
apply the regular security checks and don't assume that because they know the
message-id they must have access to the message. And make sure your regression
tests include testing the case of having thousands of messages with identical
message-ids, even though that should never arise in practice if everything
works the way it's supposed to.

--
greg

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

Предыдущее
От: Tino Wildenhain
Дата:
Сообщение: Re: PostgreSQL v8 NAMEDATALEn >=128
Следующее
От: pw
Дата:
Сообщение: How Do I Change The 'Owner' of a Database?