Postgresql Insert Only If Condition In Logic Pro