I have a software written in Python which accesses a postgres database. In order to allow several instances of the software, on one of the screens I need what is the connection identity so I check the
PID by accessing the DB and retrieving it through the function
Everything works fine except that when I check the
PID of the instance in
pg_backend_pid() I get a
PID number that does not exist in the
pg_stat_activity table. In fact i can identify the
PID number of my instance in the table but it is different than the number I received through the function
I would be happy if someone could help me understand why the
PID I got from the function is different than what exists in the table.
Thanks in advance.