Added interaction with pgsql database to the self_interactions.php file.