Fixed a bug for Postgre-SQL backend