Trying to implement the add link function and to have a better understanding of Postgres