X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 8624F9DCB50 for ; Thu, 12 Jan 2006 01:23:29 -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 95360-03 for ; Thu, 12 Jan 2006 01:23:28 -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 A88969DCB55 for ; Thu, 12 Jan 2006 01:23:26 -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 k0C5NJaO009281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 Jan 2006 22:23:21 -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 k0C5NJD4091240; Wed, 11 Jan 2006 22:23:19 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id k0C5NJWg091239; Wed, 11 Jan 2006 22:23:19 -0700 (MST) (envelope-from mfuhr) Date: Wed, 11 Jan 2006 22:23:19 -0700 From: Michael Fuhr To: Krishnendra Nandi Cc: pgsql-admin@postgresql.org Subject: Re: Rule for updating ipaddress on insertion Message-ID: <20060112052319.GA91186@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.093 required=5 tests=[AWL=0.093] X-Spam-Score: 0.093 X-Spam-Level: X-Archive-Number: 200601/142 X-Sequence-Number: 20230 On Wed, Jan 11, 2006 at 02:26:25PM +0530, Krishnendra Nandi wrote: > Could you please tell me how do i record information as to which ip > address the connection was when doing an update/insert in postgres.. > I need a trigger which would capture this information In 8.0 and later you could use inet_client_addr(). See "System Information Functions" in the "Functions and Operators" chapter of the documentation for other such functions. If you just need the IP address stored somewhere, but not necessarily in a table, then you could tweak the server's logging options. -- Michael Fuhr