bug fix SQL Error using Postgresql as DB backend
bug fix SQL Error using Postgresql as DB #25