Тупанул надо было копировать строки, а не присваивать
Task* task_ = new Task();
for (int i = 0; i < nrows; i++)
{
task_->id = atoi(PQgetvalue(res, i, 0));
strcpy(task_->task , PQgetvalue(res, i, 1));
task_->parentTask = atoi(PQgetvalue(res, i, 2));
strcpy(task_->executor , PQgetvalue(res, i, 3));
char* ddl = PQgetvalue(res, i, 4);
ddl[4] = ddl[7] = '\0';
task_->dateDeathLine->tm_year = atoi(&ddl[0]) - 1900;
task_->dateDeathLine->tm_mon = atoi(&ddl[5]) - 1;
task_->dateDeathLine->tm_mday = atoi(&ddl[8]);
ddl = PQgetvalue(res, i, 5);
ddl[4] = ddl[7] = '\0';
task_->dateStart->tm_year = atoi(&ddl[0]) - 1900;
task_->dateStart->tm_mon = atoi(&ddl[5]) - 1;
task_->dateStart->tm_mday = atoi(&ddl[8]);
strcpy(task_->status , PQgetvalue(res, i, 6));
strcpy(task_->oldtask , PQgetvalue(res, i, 7));
cout << " Id: " << task_->id;
cout << " Task: " << task_->task;
cout << " Parent: " << task_->parentTask;
cout << " Executor: " << task_->executor;
char* date_string = new char[50];
strftime(date_string, 50, " %Y-%m-%d", task_->dateDeathLine);
cout << " DeathLine: " << date_string;
strftime(date_string, 50, "%Y-%m-%d", task_->dateStart);
cout << " Start: " << date_string;
cout << " Status: " << task_->status;
cout << " Oldtask: " << task_->oldtask << endl;
vTask.push_back(task_);
}