From: | Ian Lawrence Barwick <barwick(at)gmail(dot)com> |
---|---|
To: | Gerardo Herzig <gherzig(at)fmed(dot)uba(dot)ar> |
Cc: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: uuid for each postgres install? |
Date: | 2014-09-25 22:32:19 |
Message-ID: | CAB8KJ=gZig7b7i4vkw2HjLr1dj73EvDU04xdA0QrxKzob=LW5Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
2014-09-26 6:56 GMT+09:00 Gerardo Herzig <gherzig(at)fmed(dot)uba(dot)ar>:
> ----- Mensaje original -----
>> De: "Adrian Klaver" <adrian(dot)klaver(at)aklaver(dot)com>
>> Para: pgsql-sql(at)postgresql(dot)org
>> Enviados: Jueves, 25 de Septiembre 2014 17:18:17
>> Asunto: Re: [SQL] uuid for each postgres install?
>>
>> On 09/25/2014 01:02 PM, Gerardo Herzig wrote:
>> > Hi all. Im wondering if there is, maybe at compilation time, some
>> > sort of unique identifier who identifies the actual installation.
>> >
>> > It would be even better if can be accesed in SQL form.
>> > At "initdb" time would be accepted, too.
>>
>> initdb does create a Database system identifier which can seen using
>> pg_controldata:
>>
>> postgres(at)killi:~> pg_controldata /usr/local/pgsql/data
>> pg_control version number: 903
>> Catalog version number: 201008051
>> Database system identifier: 5861256043884404217
>> Database cluster state: shut down
>>
>> A quick search showed that folks would like an SQL way of getting this
>> and that none is available as far as I can determine. The only solution
>> I could find was grepping the pg_controldata output.
>
> Well, thats are good news. At least its a good starting point.
> Thanks Adrian!
Please note that the database system identifier is generated based on the
point in time when initdb was run and is *not* guaranteed to be unique;
in the source it's described as a "hopefully-unique system identifier code" [1].
The "uniqueness" has been improved somewhat for 9.4 but as the commit
message notes, "this is still hardly guaranteed-universally-unique" [2].
[1] http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/access/transam/xlog.c;h=46eef5f21bab2bb9cb59ee9f6388c9059bb5499a;hb=HEAD
- see function BootStrapXLOG()
[2] http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=5035701e07e8bd395aa878465a102afd7b74e8c3
Regards
Ian Barwick
PS please don't top-post, it makes people grumpy and the thread harder to read.
--
Ian Barwick http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Dev Kumkar | 2014-09-26 08:06:22 | Re: [GENERAL] pg_multixact issues |
Previous Message | Gerardo Herzig | 2014-09-25 21:56:01 | Re: uuid for each postgres install? |