Fixed a sqlite3/pg incompatibility issue