agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Glyn Astill <glynastill@yahoo.co.uk>
To: Cezariusz Marek <cezariusz.marek@comarch.pl>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: IDENTIFY_SYSTEM
Date: Wed, 5 Feb 2014 11:34:48 +0000 (GMT)
Message-ID: <1391600088.5800.YahooMailNeo@web133204.mail.ir2.yahoo.com> (raw)
In-Reply-To: <08af01cf20ba$d5f0aec0$81d20c40$@comarch.pl>
References: <08af01cf20ba$d5f0aec0$81d20c40$@comarch.pl>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
> 
>
>


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



view thread (6+ messages)  latest in thread

Message-ID: <1391600088.5800.YahooMailNeo@web133204.mail.ir2.yahoo.com>
Permalink:  ../1391600088.5800.YahooMailNeo@web133204.mail.ir2.yahoo.com/
Also on:    postgresql.org/message-id/1391600088.5800.YahooMailNeo@web133204.mail.ir2.yahoo.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: glynastill@yahoo.co.uk, cezariusz.marek@comarch.pl
  Subject: Re: IDENTIFY_SYSTEM
  In-Reply-To: <1391600088.5800.YahooMailNeo@web133204.mail.ir2.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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