Re: pg_system_identifier()
От | Tom Lane |
---|---|
Тема | Re: pg_system_identifier() |
Дата | |
Msg-id | 23521.1377275791@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: pg_system_identifier() (Christopher Browne <cbbrowne@gmail.com>) |
Список | pgsql-hackers |
Christopher Browne <cbbrowne@gmail.com> writes: > On Fri, Aug 23, 2013 at 3:10 AM, Fabien COELHO <coelho@cri.ensmp.fr> wrote: >> Would it make sense for such identifiers be standard UUID >> (http://en.wikipedia.org/wiki/UUID)? > There is sense to this, sure. That ship's already sailed, though. As was pointed out upthread, we don't really want to change the way that pg_controldata prints the system ID, and we don't want this SQL function printing something different either. > I'd think that constructing a Type 5 (SHA-1) UUID based on some local > information would make a lot of sense. > In effect, based on constructing SHA-1 on a string looking like: > "Database system identifier: 5651554613500795646 > Maximum data alignment: 8 > Database block size: 8192 > WAL block size: 8192 > Maximum length of identifiers: 64 > Date/time type storage: 64-bit integers > Version: PostgreSQL 9.1.1 on x86_64-unknown-linux-gnu, compiled by > gcc (Debian 4.6.1-4) 4.6.1, 64-bit" > ==> SHA-1 of b1b012cc85149d2fe4bf0fc18c38dcf1218e95a5 Including the version string would be a seriously bad idea --- you don't want the sys ID to change just because you did a minor version upgrade, or even recompiled the same version with a newer compiler, do you? There might be some point in factoring in those other values, but I'm not terribly excited about them either. regards, tom lane
В списке pgsql-hackers по дате отправления: