"Giampaolo Tomassoni" <[EMAIL PROTECTED]> writes:
> I'm looking for a way to univocally identify the server on which a sql
> function or statement is running. My idea would be something close to the
> value returned by a 'host -f' under linux: the FQDN of the host, but even a
> serial code or a 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
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster