libpq problem with inserts

From: "Kevin Sorensen" <kevin(at)pcxcess(dot)com>
To: <pgsql-general(at)hub(dot)org>
Subject: libpq problem with inserts
Date: 2000-09-08 13:41:53
Message-ID: LNBBLFDKDBGPNAIBMDLNIEOPCKAA.kevin@pcxcess.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

i have been reading most of the night trying to figure this out, and it
may be just because i am tired that i missed something but here is the
problem i am having:

i am running a loop inserting several items into a table something kind
of similar as below, but more complicated. However, when i print the sql
strings, everything prints out and works fine, however, when i try to
insert them into the database, only some of them get inserted. i can say
that i am quite unfamiliar with libpq, but this one perl script is about
the only thing i have done with it, and it is for a cronjob. usually i use
php and have no problems. anyways, if anyone knows the answer or any ideas,
i would appreciated it.

postgresql v.7.0.0
rh linux 6.1

while ($i < 50) {
$blah1 = PQexec($conn, "INSERT INTO invoice_desc VALUES ('$val1', '$val2',
'$val3', '$val4');");
$blah2 = PQexec($conn, "INSERT INTO invoice_desc VALUES ('$val11', '$val12',
'$val13', '$val14');");
$blah3 = PQexec($conn, "INSERT INTO invoice_desc VALUES ('$val21', '$val22',
'$val23', '$val24');");
$blah4 = PQexec($conn, "INSERT INTO invoice_desc VALUES ('$val31', '$val32',
'$val33', '$val34');");
$i++;
}

my only guess is that some of the inserts are taking longer or something,
and it is just dropping them or something.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-09-08 14:12:16 Re: libpq problem with inserts
Previous Message Samy Elashmawy 2000-09-08 13:23:59 Re: Reports