Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 78A0F9FB3FC for ; Tue, 17 Oct 2006 09:18: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 62284-01-8 for ; Tue, 17 Oct 2006 09:18:29 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web33309.mail.mud.yahoo.com (web33309.mail.mud.yahoo.com [68.142.206.124]) by postgresql.org (Postfix) with SMTP id C9AFF9FB414 for ; Tue, 17 Oct 2006 09:18:26 -0300 (ADT) Received: (qmail 72939 invoked by uid 60001); 17 Oct 2006 12:18:25 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=qOCvEsxHbxJdgQIzWfyZfnAr1mtXCl8pPX03OQDdI/aaiMoHKJLeI3Q+qwS1Z9mpbj7cjmfsp0VX8FAPouIUKHt0uyltoESHUxS/A8Q+oRuH6btIezUjkM0hFa5VZJN2HyIYXyYYJWSlDaae/PEa0cHGTr7BvrBaLoxv+9WTKTc= ; Message-ID: <20061017121825.72937.qmail@web33309.mail.mud.yahoo.com> Received: from [220.225.70.2] by web33309.mail.mud.yahoo.com via HTTP; Tue, 17 Oct 2006 05:18:25 PDT Date: Tue, 17 Oct 2006 05:18:25 -0700 (PDT) From: Sandeep Khandelwal Subject: Re: Bulk Load and Extract from PostgreSQL To: "Davis, Sean \(NIH/NCI\) \[E\]" , pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.646 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, FROM_HAS_ULINE_NUMS X-Spam-Level: *** X-Archive-Number: 200610/14 X-Sequence-Number: 6297 Hi Sean.=0A=0AThe reference that you mentioned is just for Inclusion in the= SQL commands directly. But.........=0A=0AI am trying to load coma seperate= d data using COPY FROM STDIN command (TEXT mode) and using PQputCopydata AP= I. COPY FROM STDIN command requires user to specify coma seperated text ver= sion of all the data.=0A=0AMy question is: If I have binary data(bytea) the= n 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 t= o convert binary data into string.=0A=0AThanks,=0ASandeep=0A=0A=0A----- Ori= ginal Message ----=0AFrom: "Davis, Sean (NIH/NCI) [E]" =0ATo: Sandeep Khandelwal ; pgsql-interfa= ces@postgresql.org=0ASent: Tuesday, October 17, 2006 4:13:56 PM=0ASubject: = Re: [INTERFACES] Bulk Load and Extract from PostgreSQL=0A=0A=0ASandeep,=0A= =0ATry looking here:=0A=0Ahttp://www.postgresql.org/docs/8.1/interactive/li= bpq-exec.html=0A=0AUnder "Escaping Binary Strings for Inclusion in SQL Comm= ands"? Will that satisfy your needs, or did I miss what you are trying to = do?=0A=0ASean=0A=0A=0A=0A-----Original Message-----=0AFrom: Sandeep Khandel= wal [mailto:sandeep_khandelwal27@yahoo.com]=0ASent: Tue 10/17/2006 1:36 AM= =0ATo: Davis, Sean (NIH/NCI) [E]; pgsql-interfaces@postgresql.org=0ASubject= : Re: [INTERFACES] Bulk Load and Extract from PostgreSQL=0A=0AHi Sean.=0A= =0AThanks for the reply.=0A=0AI have one more question. While extracting da= ta using COPT TO command (in TEXT mode) we have an API, PQunescapeBytea, to= convert string representation of binary data(bytea) into binary. Similary = we need to convert binary data into it's string representation while loadin= g data into PostgreSQL ,using COPY FROM command in TEXT mode, with PQputCop= ydata. But there is no API to convert binary data into it's string represen= tation. Could you tell me API or I am misinterpreting something.=0A=0AThank= s in advance,=0ASandeep=0A=0A=0A----- Original Message ----=0AFrom: Sean Da= vis =0ATo: pgsql-interfaces@postgresql.org=0ACc: Sand= eep Khandelwal =0ASent: Monday, October 16,= 2006 4:04:45 PM=0ASubject: Re: [INTERFACES] Bulk Load and Extract from Pos= tgreSQL=0A=0A=0AOn Monday 16 October 2006 03:07, Sandeep Khandelwal wrote:= =0A> Hi All.=0A>=0A> I want to extract and Load data from PostgreSQL using = Libpq C API. Please=0A> let me know which approach will be good to load lar= ge number of rows into=0A> PostgreSQL(Insert or COPY FROM) and, which appro= ach will be good to extract=0A> large number of rows from PostgreSQL (COPY = TO or SELECT). I want to handle=0A> all the data types supported in the Pos= tgreSQL.=0A=0Acopy is the faster way to go for a single table. =0A=0ASean= =0A=0A---------------------------(end of broadcast)------------------------= ---=0ATIP 9: In versions below 8.0, the planner will ignore your desire to= =0A choose an index scan if your joining column's datatypes do not=0A= match=0A=0A=0A=0A=0A---------------------------(end of broadcast)---= ------------------------=0ATIP 1: if posting/reading through Usenet, please= send an appropriate=0A subscribe-nomail command to majordomo@postgre= sql.org so that your=0A message can get through to the mailing list c= leanly=0A=0A