Re: PQendcopy error in multithreading

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Durgaprasad Pawar <durgaprasad(dot)pawar(at)yahoo(dot)co(dot)in>
Cc: pg novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: PQendcopy error in multithreading
Date: 2007-09-11 08:24:15
Message-ID: 46E650AF.8010901@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Durgaprasad Pawar wrote:
> Hi,
> I am trying to update multiple tables using the
> 'PQputline/PQendcopy' function. The code works fine if the tables are
> updated one after the other.
> However, if there are multiple threads trying to copy data into
> different tables, the function fails. i.e. if one thread has started its
> copy operation and if some other thread also starts its copy operation
> (on different table), one of them fails.
> Strangely, the PQputline function is successful for both the threads
> after the end delimiter is sent (\.).
> What might be the reason for this PQendcopy failure? How do I get the
> exact error message after the failure?

Are you trying to do this using the same connection in different
threads, or does each thread have its own connection? I suspect you are
trying to do the former.

Sean

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Sean Davis 2007-09-11 10:39:57 Re: PQendcopy error in multithreading
Previous Message Durgaprasad Pawar 2007-09-11 05:39:20 PQendcopy error in multithreading