FIX for pgsql Invalid column reference