We are running a Django application with a AWS Aurora (PostgreSQL) database and are debugging some of our queries.
When we look at the running queries using following statement:
select
pid,
usename,
datname,
application_name,
client_addr,
query,
now() - query_start
from
pg_stat_activity
where
usename <> 'rdsadmin';
We see a lot of duplicate queries where client_addr = <null>
. The application_name and user however are the same (= our Django app). Most queries from our Django app include the correct client_addr
.
Can someone explain why we see these duplicate queries that contain no client_addr
?
From the official document:
IP address of the client connected to this backend. If this field is null, it indicates either that the client is connected via a Unix socket on the server machine or that this is an internal process such as autovacuum.