Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2F42B6374C5 for ; Tue, 20 Jul 2010 15:58:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 36866-08 for ; Tue, 20 Jul 2010 18:58:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id 098E363750F for ; Tue, 20 Jul 2010 15:58:11 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 2472E2843A; Tue, 20 Jul 2010 14:58:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=A+uSLLARUDObcmf0cFHbU2tH72E=; b=gk3aOx WXCPLlp8ACWi+PfykNtxyjM+e2jdMuJPpjBabRJnD5LXl16dLBSziBT+LUrN9Rur GsIsiJpFH1OkDW0th+ycMEUw1rwFyqX/NHx/T0E0K+PV7nTPZ7OgdDw0hHWCa2HV uD2s/BEHZmKx5q265pxT2GSjSkzxE0E36bbUY= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 21AAA28434; Tue, 20 Jul 2010 14:58:10 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id E87FFA200; Tue, 20 Jul 2010 14:58:09 -0400 (EDT) Date: Tue, 20 Jul 2010 14:58:09 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Matthew Wakeling cc: Kevin Grittner , Maciek Sakrejda , Samuel Gendler , pgsql-jdbc@postgresql.org Subject: Re: Trouble with COPY IN In-Reply-To: Message-ID: References: <4C4562C50200002500033951@gw.wicourts.gov> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/65 X-Sequence-Number: 20730 On Tue, 20 Jul 2010, Matthew Wakeling wrote: > Okay, have investigated a little further. It seems that the server may be > responding to the client a little too quickly with the "all done" message. > Here is a sequence of events in core.v3.QueryExecutorImpl: > > We call startCopy(). It calls processCopyResults(). > In processCopyResults, we receive character G, and we lock. > > We call writeToCopy(). It calls processCopyResults(). > We receive character C. > We receive character Z, and unlock. > > We call endCopy(), which tries to unlock and fails. > > > So, should the unlocking happen elsewhere, or should endCopy not require a > lock? To me it seems like a protocol violation to receive CommandComplete(C) and ReadyForQuery(Z) before we've issued CopyDone(c) and this should be fixed server side. Kris Jurka