From: Michael Fuhr <mike@fuhr.org>
To: Krishnendra Nandi <krishnendra.nandi@hewitt.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Rule for updating ipaddress on insertion
Date: Wed, 11 Jan 2006 22:23:19 -0700
Message-ID: <20060112052319.GA91186@winnie.fuhr.org> (raw)
In-Reply-To: <OF85193D0B.E183FB07-ON652570F3.002B80FE-652570F3.00311D70@hewitt.com>
References: <OF85193D0B.E183FB07-ON652570F3.002B80FE-652570F3.00311D70@hewitt.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: mike@fuhr.org, krishnendra.nandi@hewitt.com
Subject: Re: Rule for updating ipaddress on insertion
In-Reply-To: <20060112052319.GA91186@winnie.fuhr.org>
References: <OF85193D0B.E183FB07-ON652570F3.002B80FE-652570F3.00311D70@hewitt.com> <20060112052319.GA91186@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox