agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
uuid for each postgres install?
4+ messages / 3 participants
[nested] [flat]

* uuid for each postgres install?
@ 2014-09-25 20:02  Gerardo Herzig <gherzig@fmed.uba.ar>
  0 siblings, 1 reply; 4+ messages in thread

From: Gerardo Herzig @ 2014-09-25 20:02 UTC (permalink / raw)
  To: pgsql-sql

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.


Thanks!

Gerardo


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: uuid for each postgres install?
@ 2014-09-25 20:18  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Gerardo Herzig <gherzig@fmed.uba.ar>
  0 siblings, 1 reply; 4+ messages in thread

From: Adrian Klaver @ 2014-09-25 20:18 UTC (permalink / raw)
  To: pgsql-sql

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@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.

>
>
> Thanks!
>
> Gerardo
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: uuid for each postgres install?
@ 2014-09-25 21:56  Gerardo Herzig <gherzig@fmed.uba.ar>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Gerardo Herzig @ 2014-09-25 21:56 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-sql

Well, thats are good news. At least its a good starting point.
Thanks Adrian!

Gerardo

----- Mensaje original -----
> De: "Adrian Klaver" <adrian.klaver@aklaver.com>
> Para: pgsql-sql@postgresql.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@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.
> 
> >
> >
> > Thanks!
> >
> > Gerardo
> >
> >
> 
> 
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
> 
> 
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
> 


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: uuid for each postgres install?
@ 2014-09-25 22:32  Ian Lawrence Barwick <barwick@gmail.com>
  parent: Gerardo Herzig <gherzig@fmed.uba.ar>
  0 siblings, 0 replies; 4+ messages in thread

From: Ian Lawrence Barwick @ 2014-09-25 22:32 UTC (permalink / raw)
  To: Gerardo Herzig <gherzig@fmed.uba.ar>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-sql

2014-09-26 6:56 GMT+09:00 Gerardo Herzig <gherzig@fmed.uba.ar>:
> ----- Mensaje original -----
>> De: "Adrian Klaver" <adrian.klaver@aklaver.com>
>> Para: pgsql-sql@postgresql.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@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=46ee...
- see function BootStrapXLOG()
[2] http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=5035701e07e8bd395aa878465a102afd7b74e8...

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


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2014-09-25 22:32 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-09-25 20:02 uuid for each postgres install? Gerardo Herzig <gherzig@fmed.uba.ar>
2014-09-25 20:18 ` Adrian Klaver <adrian.klaver@aklaver.com>
2014-09-25 21:56   ` Gerardo Herzig <gherzig@fmed.uba.ar>
2014-09-25 22:32     ` Ian Lawrence Barwick <barwick@gmail.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox