From: Alexis Paul Bertolini <bertolini@computer.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: Obtaining client IP address
Date: Sat, 25 Feb 2006 10:26:53 +0100
Message-ID: <440022DD.9000902@computer.org> (raw)
In-Reply-To: <20060224233427.GA12772@winnie.fuhr.org>
References: <43FF93CF.5070808@computer.org>
<20060224233427.GA12772@winnie.fuhr.org>
Michael Fuhr wrote:
> On Sat, Feb 25, 2006 at 12:16:31AM +0100, Alexis Paul Bertolini wrote:
>
>> The client has no idea what public IP it has. The server ought to
>> know... however I haven't found how I could get this info into my query.
>>
>
> What version of PostgreSQL are you running? In 8.0 and later you
> can use inet_client_addr().
>
> http://www.postgresql.org/docs/8.1/interactive/functions-info.html
>
> I forget if earlier versions have a way to get the client's IP
> address without resorting to hacks (e.g., writing a function in a
> privileged language like plperlu and calling netstat or lsof).
>
>
Mmmm, I didn't spot that one, but it did the trick! Thanks!
Alex.
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: bertolini@computer.org
Subject: Re: Obtaining client IP address
In-Reply-To: <440022DD.9000902@computer.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox