Re: Postgres insert performance and storage requirement compared to Oracle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Wed, Oct 27, 2010 at 10:00 AM, Divakar Singh <dpsmails@xxxxxxxxx> wrote:

    for (; i<howmany;i++ )
    {

    sprintf (query, "INSERT INTO aaaa(a, b, c, d, e, f, g, h, j, k, l, m, n, p) VALUES (67, 'ABRAKADABRA', 'ABRAKADABRA', 'ABRAKADABRA', '1-Dec-2010', 'ABRAKADABRA', 'ABRAKADABRA',  'ABRAKADABRA', '1-Dec-2010', 99999, 99999, %d, 9999, 'ABRAKADABRAABRAKADABRAABRAKADABRAABRAKADABRAABRAKADABRAABRAKADABRAABRAKADABRAABRAKADABRAABRAKADABRAABRAKADABRAABRAKADABRAABRAKADABRA')", i);

    res = PQexec(conn, query);

      if (PQresultStatus(res) != PGRES_COMMAND_OK)
        {
          cout<<"error at iteration "<<i<<":"<<PQresultErrorMessage(res)<<endl;
                  PQclear(res);
          break;
        }
        //PQclear(res);


    }

Why is that PQclear(res) commented out? You're leaking result status for every insert.


--
- David T. Wilson
david.t.wilson@xxxxxxxxx

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux