Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4AC099FB39F for ; Tue, 17 Oct 2006 09:23:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 63197-02 for ; Tue, 17 Oct 2006 09:23:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from nihrelayxway2.hub.nih.gov (nihrelayxway2.hub.nih.gov [128.231.90.107]) by postgresql.org (Postfix) with ESMTP id CE9C59FA298 for ; Tue, 17 Oct 2006 09:23:29 -0300 (ADT) Received: from pressa.nci.nih.gov ([137.187.209.230]) by nihrelayxway2.hub.nih.gov with ESMTP; 17 Oct 2006 08:23:29 -0400 X-IronPortListener: NIH_Relay X-SBRS: None X-IronPort-AV: i="4.09,320,1157342400"; d="scan'208"; a="203472778:sNHT14327008" From: Sean Davis Reply-To: sdavis2@mail.nih.gov Organization: NIH/NCI To: Sandeep Khandelwal Subject: Re: Bulk Load and Extract from PostgreSQL Date: Tue, 17 Oct 2006 08:23:14 -0400 User-Agent: KMail/1.9.1 Cc: pgsql-interfaces@postgresql.org References: <20061017121825.72937.qmail@web33309.mail.mud.yahoo.com> In-Reply-To: <20061017121825.72937.qmail@web33309.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610170823.14970.sdavis2@mail.nih.gov> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/15 X-Sequence-Number: 6298 On Tuesday 17 October 2006 08:18, Sandeep Khandelwal wrote: > Hi Sean. > > The reference that you mentioned is just for Inclusion in the SQL commands > directly. But......... > > I am trying to load coma seperated data using COPY FROM STDIN command (TEXT > mode) and using PQputCopydata API. COPY FROM STDIN command requires user to > specify coma seperated text version of all the data. > > My question is: If I have binary data(bytea) then I have to convert this > data into string (char *) form and pass this data to PostgreSQL using > PQputCopydata API. And, I don't have any API in Libpq to convert binary > data into string. Sandeep, I see the issue--sorry about the misunderstanding. I'm not sure what the "correct" answer is, but you could simply do base64 client-side encoding and decoding of your data. Sean