From: | David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com> |
---|---|
To: | Divakar Singh <dpsmails(at)yahoo(dot)com> |
Cc: | Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, jd(at)commandprompt(dot)com, pgsql-performance(at)postgresql(dot)org |
Subject: | Re: Postgres insert performance and storage requirement compared to Oracle |
Date: | 2010-10-27 15:50:46 |
Message-ID: | AANLkTinUWnfp8v0s2dugH=M1fwDBkUExiSsJj81Yst_s@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
On Wed, Oct 27, 2010 at 10:00 AM, Divakar Singh <dpsmails(at)yahoo(dot)com> 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(dot)t(dot)wilson(at)gmail(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2010-10-27 16:09:46 | Re: Regression: 8.3 2 seconds -> 8.4 100+ seconds |
Previous Message | Reid Thompson | 2010-10-27 15:49:41 | Re: Postgres insert performance and storage requirement compared to Oracle |