Re: IDENTIFY_SYSTEM

Поиск
Список
Период
Сортировка
От Glyn Astill
Тема Re: IDENTIFY_SYSTEM
Дата
Msg-id 1391600088.5800.YahooMailNeo@web133204.mail.ir2.yahoo.com
обсуждение исходный текст
Ответ на IDENTIFY_SYSTEM  ("Cezariusz Marek" <cezariusz.marek@comarch.pl>)
Ответы Re: IDENTIFY_SYSTEM  ("Cezariusz Marek" <cezariusz.marek@comarch.pl>)
Список pgsql-sql
____________________________

> From: Cezariusz Marek <cezariusz.marek@comarch.pl>
>To: pgsql-sql@postgresql.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@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
> 
>
>



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

Предыдущее
От: "Cezariusz Marek"
Дата:
Сообщение: IDENTIFY_SYSTEM
Следующее
От: "Cezariusz Marek"
Дата:
Сообщение: Re: IDENTIFY_SYSTEM