X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 32A469DC848 for ; Fri, 24 Feb 2006 19:34:34 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18037-09 for ; Fri, 24 Feb 2006 19:34:36 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 549139DC814 for ; Fri, 24 Feb 2006 19:34:31 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id k1ONYRcT071272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 24 Feb 2006 16:34:30 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id k1ONYREU020693; Fri, 24 Feb 2006 16:34:27 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id k1ONYR3Z020692; Fri, 24 Feb 2006 16:34:27 -0700 (MST) (envelope-from mfuhr) Date: Fri, 24 Feb 2006 16:34:27 -0700 From: Michael Fuhr To: Alexis Paul Bertolini Cc: pgsql-sql@postgresql.org Subject: Re: Obtaining client IP address Message-ID: <20060224233427.GA12772@winnie.fuhr.org> References: <43FF93CF.5070808@computer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43FF93CF.5070808@computer.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.122 required=5 tests=[AWL=0.122] X-Spam-Score: 0.122 X-Spam-Level: X-Archive-Number: 200602/307 X-Sequence-Number: 24317 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