use extract(month instead of month for postgres
version is char not int
severe error if error executing database query
fixes to work with postgresql
fixes to work with postgresql