Make relation_add sql function prefill entity tables if needed
instead of depending on the proper behavior of the user of the ProvenanceStoragePostgresql user.
splited from !154 (closed) and Depends on !155 (closed)
Migrated from D8670 (view on Phabricator)