From: | Glyn Astill <glynastill(at)yahoo(dot)co(dot)uk> |
---|---|
To: | Cezariusz Marek <cezariusz(dot)marek(at)comarch(dot)pl>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: IDENTIFY_SYSTEM |
Date: | 2014-02-05 11:34:48 |
Message-ID: | 1391600088.5800.YahooMailNeo@web133204.mail.ir2.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
____________________________
> From: Cezariusz Marek <cezariusz(dot)marek(at)comarch(dot)pl>
>To: pgsql-sql(at)postgresql(dot)org
>Sent: Monday, 3 February 2014, 8:35
>Subject: [SQL] IDENTIFY_SYSTEM
>
>
>
>Hello,
>
>Is there a way to call IDENTIFY_SYSTEM command from SQL? Or otherwise get the unique system identifier from a function? I need some unique database indentifier for the licensing purposes.
>
That's part of the streaming replication protocol
http://www.postgresql.org/docs/9.3/static/protocol-replication.html
As long as you're using wal_level >= archive and the replication connection is enabled you can retrieve it via psql
http://www.postgresql.org/message-id/AANLkTimFVHvhG73rPykX1z57MvPgskxJY1JuRYrD9Cf_@mail.gmail.com
glyn(at)test:~$ psql "replication=1" -c "IDENTIFY_SYSTEM"
systemid | timeline | xlogpos
---------------------+----------+-----------
5972513070019772415 | 1 | 0/2EE0368
If it's just for licencing perhaps inet_server_addr() or a plperl function to grab the mac address of the machine might suffice?
>--
>Cezariusz Marek
>Mobile +48 608 646 494, Phone +48 33 484 6900, http://www.comarch.com/
>Comarch SA, ul. Michałowicza 12, 43-300 Bielsko-Biała, POLAND
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Cezariusz Marek | 2014-02-05 12:01:59 | Re: IDENTIFY_SYSTEM |
Previous Message | Cezariusz Marek | 2014-02-03 08:35:04 | IDENTIFY_SYSTEM |