Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 76837133655C for ; Thu, 14 Apr 2011 21:31:00 -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 61028-03 for ; Fri, 15 Apr 2011 00:30:49 +0000 (UTC) X-Greylist: delayed 00:39:25.870918 by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mail.postgresql.org (Postfix) with ESMTP id EABA1133616B for ; Thu, 14 Apr 2011 21:30:47 -0300 (ADT) Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3ENpJBe004900 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Apr 2011 19:51:19 -0400 Received: from [10.11.10.23] (vpn-10-23.rdu.redhat.com [10.11.10.23]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3ENpINg021918; Thu, 14 Apr 2011 19:51:18 -0400 Subject: Re: BYTEA Fields and Memory Consumption From: Ramesh Reddy Reply-To: rareddy@redhat.com To: Hiroshi Inoue Cc: Raiford@labware.com, pgsql-odbc@postgresql.org In-Reply-To: <4DA7864D.2010506@tpf.co.jp> References: <4DA5122F.5000606@gmx.net> <4DA66CF9.8080408@tpf.co.jp> <4DA7864D.2010506@tpf.co.jp> Content-Type: text/plain; charset="UTF-8" Organization: Red Hat Date: Thu, 14 Apr 2011 18:48:21 -0500 Message-ID: <1302824901.3497.26.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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: 201104/18 X-Sequence-Number: 10646 In my experience even when using 'lo' the driver only got the first chunk of data which is equal to the length of the buffer that client provided and never went back to ask for next chunk. Also, I am not sure how one can read multiple blocks from client code? Ramesh.. On Fri, 2011-04-15 at 08:42 +0900, Hiroshi Inoue wrote: > (2011/04/14 21:17), Raiford@labware.com wrote: > > Hi Hiroshi-san, > > > > Thank you for your response. Could you clarify one thing for me? Are you > > suggesting that when using an lo datatype with the lo module installed, > > You don't have to install the lo module. Please type > > create domain lo as oid; > > and use the lo type. > > > the ODBC driver automatically sends the data in pieces? > > Yes. > > regards, > Hiroshi Inoue > > > Or does it only > > open the possibility for me to use the lo_import() function? If > > everything is handled internally in the ODBC driver, it would certainly > > help a lot :) > > > > Jon > > > > From: Hiroshi Inoue > > To: Raiford@labware.com > > Cc: pgsql-odbc@postgresql.org > > Date: 04/13/2011 11:42 PM > > Subject: Re: [ODBC] BYTEA Fields and Memory Consumption > > Sent by: pgsql-odbc-owner@postgresql.org > > ------------------------------------------------------------------------ > > > > Hi, > > > > (2011/04/13 21:09), Raiford@labware.com wrote: > > > I have an issue where even though I break a large BYTEA object up into > > > multiple pieces, the ODBC driver just rejoins the pieces in memory and > > > tries to send it all out at once. I took a look at the code and sure > > > enough the driver just keeps reallocating memory for each chunk of data > > > that I add. > > > > Yes you are right. > > > > > Can I assume Postgres has no mechanism to send this data > > > across the wire in pieces? Are there any common practices for dealing > > > with this? > > > > Please try lo type instead of bytea type. > > > > regards, > > Hiroshi Inoue >