Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1A0B4632EE5 for ; Wed, 28 Jul 2010 13:53:59 -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 51455-07; Wed, 28 Jul 2010 16:53:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 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 6CF75632AC1; Wed, 28 Jul 2010 13:53:51 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id B82C62844C; Wed, 28 Jul 2010 12:53:49 -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=YVsvXf8aHYS4EETNnu+/uBpO3zg=; b=ENq3tW nty5ASasp4ISDzm3rFo4LxY1GwBl0gGghB0WZQERogtMBGoJZUPYLGllSWuYTLDv o5JB3148qkgM2EC6Vt/Jk2xrsK+mrrubgHP2hVhG72y9pcrPszQmykDJg4aswj+7 adeKbyD2WQFunjMcmBO6f9Z73CRORCO8k6LFI= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id B13182844B; Wed, 28 Jul 2010 12:53:49 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 8370CA206; Wed, 28 Jul 2010 12:53:49 -0400 (EDT) Date: Wed, 28 Jul 2010 12:53:49 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: James William Pye cc: Tom Lane , pgsql-hackers@postgresql.org, Matthew Wakeling , Kevin Grittner , Maciek Sakrejda , Samuel Gendler , pgsql-jdbc@postgresql.org Subject: Re: [HACKERS] Trouble with COPY IN In-Reply-To: <41218459-EDA4-4005-B791-2392991150AC@jwp.name> Message-ID: References: <4C4562C50200002500033951@gw.wicourts.gov> <9143.1279892435@sss.pgh.pa.us> <4C499E26.4060307@ejurka.com> <9653.1279894296@sss.pgh.pa.us> <7E743A09-D012-4BBB-9B87-24CA1DF51015@jwp.name> <41218459-EDA4-4005-B791-2392991150AC@jwp.name> 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/119 X-Sequence-Number: 20784 On Wed, 28 Jul 2010, James William Pye wrote: > > hrm, I suppose a lazy way around that problem would be to suspend all > client messages(client_min_messages) during COPY IN. Tho, I guess one > would still have to contend with NotificationResponse, and > ParameterStatus.. Technically you won't get NotificationResponse until transaction end, so you don't need to worry about that mid copy. > I don't think you would have to peek in. If the interface were to always > hold onto the last message or last n-bytes submitted to be sent, it > would be able to send the possible CopyData(EOF) and CopyDone once the > COPY operation (at the interface level) is closed/shutdown/terminated. > Granted, this is dependent on CopyData(EOF) not being in the middle of > regular CopyData, but I gather that that would end in an ErrorResponse > anyways. One of the key points of confusion is that CopyData(EOF) does not result in an error. It results in ignoring any futher data. The problem I have is that for text mode it waits for CopyDone, but in binary mode it ends the copy sequence immediately. Additionally the interface exposed by the JDBC driver lets the user write arbitrary CopyData bytes to the server, so without parsing all of that we don't know whether they've issued CopyData(EOF) or not. Kris Jurka