How to fix Raise exception in PostgreSQL | DevErrors