Re: Rule for updating ipaddress on insertion

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Krishnendra Nandi <krishnendra(dot)nandi(at)hewitt(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Rule for updating ipaddress on insertion
Date: 2006-01-12 05:23:19
Message-ID: 20060112052319.GA91186@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Michael Fuhr 2006-01-12 05:32:53 Re: how can we use outer join in Postures
Previous Message Michael Fuhr 2006-01-12 05:16:05 Re: strange system columns