|
Home > Archive > PostgreSQL Administration > January 2006 > Rule for updating ipaddress on insertion
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Rule for updating ipaddress on insertion
|
|
| Krishnendra Nandi 2006-01-12, 3:24 am |
| 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
Thanks and Regards
Krishnendra Nandi
Hewitt Associates India (Pvt.) Ltd.
Unitech World
Sector-39, Gurgaon
Haryana-India
The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to yo
u in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly p
rohibited.
| |
| Tom Lane 2006-01-12, 3:24 am |
| "Krishnendra Nandi" <krishnendra.nandi@hewitt.com> writes:
> 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 recent PG releases this info is available, see "Session Information
Functions" here:
http://www.postgresql.org/docs/8.0/...tions-info.html
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
| |
| Michael Fuhr 2006-01-12, 3:24 am |
| 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
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
|
|
|
|
|