Re: Obtaining client IP address

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Alexis Paul Bertolini <bertolini(at)computer(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Obtaining client IP address
Date: 2006-02-24 23:34:27
Message-ID: 20060224233427.GA12772@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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).

--
Michael Fuhr

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2006-02-25 04:51:31 Re: CREATE TABLE AS and tablespaces
Previous Message Alexis Paul Bertolini 2006-02-24 23:16:31 Obtaining client IP address