how to delete in postgres all record references code example
Example 1: delete entries in postgresql
DELETE FROM table WHERE condition;
Example 2: delete entries in postgresql
DELETE FROM table
USING another_table
WHERE table.id = another_table.id;