Feature v2 postgres compatible

changes for compatible to Postgresql.
main change is support postgres SQL statement end with 'RERURNING' instead of insert_id();
usage:
<?php
$stmt = $this->db->query("INSER INTO tbl VALUSE (...) RERURNING id");
// OR $stmt = $this->db->insert_returning($tbl, $data, 'id');
if ($stmt->num_rows())
{
    $newid = (int) $stmt->row()->project_id;
}
else
{
    $newid = FALSE;
}
?>