Re: Obtaining client IP address - Mailing list pgsql-sql

From Alexis Paul Bertolini
Subject Re: Obtaining client IP address
Date
Msg-id 440022DD.9000902@computer.org
Whole thread Raw
In response to Re: Obtaining client IP address  (Michael Fuhr <mike@fuhr.org>)
List pgsql-sql
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.


pgsql-sql by date:

Previous
From: "Yasuhiro Furuse"
Date:
Subject: Relation 0 does not exist
Next
From: Richard C
Date:
Subject: Re: "Installing" dbLink