Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 184E59FC225 for ; Fri, 1 Jun 2007 09:53:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 16061-03 for ; Fri, 1 Jun 2007 09:53:20 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by postgresql.org (Postfix) with ESMTP id 66B679FC237 for ; Fri, 1 Jun 2007 09:53:21 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id v27so665464wah for ; Fri, 01 Jun 2007 05:53:20 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=JJO2eGizM60H+ClUO5TAoEg8dN0T8KL84K0CiTb1g27R2RiUdwOOMwOnEDi3i/IOIWt6Wlm+Q3LSs56R68GfbCTfAZ/JG6wY4FNv9usS0OaxoNPt60fpFTlBCqUNZilDOzfrTvkLb3FVBkLVl3PUGOi3gKy2YiLexMtxxSV7nCI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=O6auqpkLbcMPBsYI/Y0a6G3N6Ik+c9i+v3x6USQG9k5cr3gkO8mO75+nflcb/ah4Y1x3vhTjZAUesXeklwVJH3LcsnNkSBqC60fFcgj4HgH5VL31bx9tRnmunRBdFaAeF3TC0fexTkTVvX5jWq8tluevNs101FxYOgHdQ0CX5Q8= Received: by 10.115.61.1 with SMTP id o1mr1751597wak.1180702399149; Fri, 01 Jun 2007 05:53:19 -0700 (PDT) Received: by 10.114.151.9 with HTTP; Fri, 1 Jun 2007 05:53:18 -0700 (PDT) Message-ID: Date: Fri, 1 Jun 2007 15:53:18 +0300 From: "Kalle Hallivuori" To: pgsql-jdbc@postgresql.org Subject: Re: FYI: porting Copy API to 8.x In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <66D125B2-3C81-467E-BC02-D784ACDD5499@fastcrypt.com> X-Google-Sender-Auth: d85478cb0ecf5c5e X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/3 X-Sequence-Number: 17065 Hi again. 2007/5/31, Dave Cramer : > I think you have to make it an extension somehow. I'd leave > getCopyAPI in place, I think the harder part is getting the protocol > to work, I found these hooks for protocol level implementation at end of org.postgresql.core.v3.QueryExecutorImpl.processResults(): case 'G': // CopyInResponse case 'H': // CopyOutResponse case 'c': // CopyDone case 'd': // CopyData { // COPY FROM STDIN / COPY TO STDOUT, neither of which are currently // supported. ... handler.handleError(new PSQLException(GT.tr("The driver currently does not support COPY operations."), PSQLState.NOT_IMPLEMENTED)); } break; AFAIK (counting out breaking current design) the only way to implement this at protocol level without touching core.v3 would be to clone the whole package with every class inherited from core.v3, and copy contents of QueryExecutorImpl there. I'd rather not. Problem is that class has its stuff (pgStream) declared as private, so I can't just inherit a class to override that single method. Furthermore, I'd end up duplicating the protocol support implemented in original version of that method. Thus, I'll edit it in place. Even if it ends up in a rejected patch at least the patch gets it right. The protocol spec is clear enough by itself. I'll still have to look how to best pass the CopyData rows between BE and application. They could probably be encapsulated as tuples, but I'll have to read a bit more to find out the best way. I won't handle field types (text/binary in the protocol level) because I'm looking forward to a solution where I could pass whole or possibly even multiple rows as raw(ish) byte[] at once. If this becomes a barrier for acceptance I can reconsider. Thanks for the clear source. It is what makes enhancements such as this possible on short notice. So no commits this week, but there's still hoping I'll get something out. -- Kalle Hallivuori +358-41-5053073 http://korpiq.iki.fi/