PostgreSQL: storing connection IP address in a table

I would like to have a column in a Postgres table that will store the remote IP address of the user connecting to the database. I think of the "inet" data type with some kind of default restriction. Any ideas?

Thank.

+3
source share
3 answers

Feature for you inet_client_addr().

+6
source

? IP- , psql, , Postgres ? -, inet .

0

Request that all ip clients connect to the database

SELECT client_addr FROM pg_stat_activity
0
source

Source: https://habr.com/ru/post/1731159/


All Articles