Question: I am trying to get a "datetime" from a csv file and insert it into MySql Database. What am I doing wrong? Thanks in advance!

```
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) 
            {
                $date = new Datetime();
                $this->date->format('Y-d-m H:i:s', ($data[3]));

                $sql = "INSERT INTO logs(ID, User, Flag, Date) values('$data[0]', '$data[1]', '$data[2]', '$data[3]')";
                $insert = $this->dataBase->getData($sql);

```

Answer: 
I ran into the same problem while building the centos 5 version of postgresql (8.2) for centos 7 (3.10.0-229.el7.x86\_64.)

I wasn't able to make it work with gcc-4.8.3 using the CFLAGS="-O1" trick, but switching to clang (3.4.2) as the compiler (CC=clang) did work for me (and it worked at the default -O2 optimization level.)
I ran in the same problem.
I have a production database in release 9.1 of Postgres and i must reinstall it on a new host.
I’m trying this on a Centos8 and a Debian11
gcc version 8.5.0

I used the CFLAGS environment variable :

```
export CFLAGS=-fno-aggressive-loop-optimizations

```

Others -O1 or clang didn’t work at all.
Then, everything worked perfect :

```
./configure --enable-debug  --enable-depend --prefix=$PG_HOME
gmake -j 5 world 
gmake check

```

No more errors