Re: Per-server univocal identifier - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Per-server univocal identifier
Date
Msg-id 24530.1150585967@sss.pgh.pa.us
Whole thread Raw
In response to Per-server univocal identifier  ("Giampaolo Tomassoni" <g.tomassoni@libero.it>)
Responses R: Per-server univocal identifier  ("Giampaolo Tomassoni" <g.tomassoni@libero.it>)
List pgsql-hackers
"Giampaolo Tomassoni" <g.tomassoni@libero.it> writes:
> I'm looking for a way to univocally identify the server on which a sql function or statement is running. My idea
wouldbe something close to the value returned by a 'host -f' under linux: the FQDN of the host, but even a serial code
ora number would be fine to me. It needs only to be immutable, I guess.
 

Perhaps inet_server_addr() and inet_server_port() would answer.  These
aren't super-useful on local connections, however.

How "immutable" do you want it to be exactly?  The system_identifier
embedded in pg_control might be interesting if you want something that
will change at initdb.  I don't think there's a way to look at that from
SQL but you could write a C function to access it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Giampaolo Tomassoni"
Date:
Subject: Per-server univocal identifier
Next
From: "Giampaolo Tomassoni"
Date:
Subject: R: Per-server univocal identifier