PostgreSQL: store IP address of a connection in a table

default-value, ip-address, postgresql

Solution

The function for you is `inet_client_addr()`.

Problem

I'd like to have a column in a Postgres table which will store the remote IP address of the user connecting to the database. I'm thinking of data type "inet" with some sort of default constraint. Any ideas? Thanks.

Original source