Fix: sql syntax error with pgsql