Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1DFAB9FA2CA for ; Wed, 18 Oct 2006 02:23:10 -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 59251-03 for ; Wed, 18 Oct 2006 02:23:07 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web33315.mail.mud.yahoo.com (web33315.mail.mud.yahoo.com [68.142.206.130]) by postgresql.org (Postfix) with SMTP id EEA0D9FB1D6 for ; Wed, 18 Oct 2006 02:23:06 -0300 (ADT) Received: (qmail 34518 invoked by uid 60001); 18 Oct 2006 05:23:01 -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=g6XeWTyxYJXgKSqZ8ixCfoA4MyOCfUhNg82rHUAzNlj+Y0Ooj6Li5epcSrSdq2KZ5L2DpJObDTCHD618rbLeHfDkoDxMrQYgZuEZ5YdEJVO0QFRwhmoBvUoct2chkI3sOM58+dRvkAt60qrHl84WNGO30l0Gt/4T5gh7vEdmcaI= ; Message-ID: <20061018052301.34516.qmail@web33315.mail.mud.yahoo.com> Received: from [220.225.70.2] by web33315.mail.mud.yahoo.com via HTTP; Tue, 17 Oct 2006 22:23:01 PDT Date: Tue, 17 Oct 2006 22:23:01 -0700 (PDT) From: Sandeep Khandelwal Subject: Bulk Load and Extract from PostgreSQL To: 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/18 X-Sequence-Number: 6301 Hi All.=0A=0AI want to read and write bulk data into PostgreSQL using Libpq= C API and right now I am under the investigation phase. Also want to delet= e and update into PostgreSQL using Libpq API.=0A=0APLease let me know=0A=0A= Read - =0AI am planning to use COPY DATA TO command in TEXT mode for readin= g, I am using PQgetCopydata function to get data one row at a time.=0AProbl= em - =0Aa - Not sure whether PQgetCopydata will give NULL terminated string= or \n terminated string.=0Ab - I know that PQgetCopydata API will give dat= a of all the rows , seperated by delimiter, in TEXT format. But don't know = how to convert this text data into corresponding data type, especially BYTE= A.=0Ac - Don't know what are the special characters and how these are hande= led by PQgetCopydata and How I should hendel them.=0A=0ALoad - =0AI am plan= ning to use COPY DATA FROM command in TEXT mode for writing, I am using PQp= utCopydata function to send data one row at a time.=0AProblem - =0Aa - Not = sure what are the special characters and how I should miodify them.=0Ab - P= QputCopydata API takes data of all the rows, seperated by delimiter, ini st= ring representation. Don't know how to convert all the datatypes into strin= g representation, especially BYTEA.=0A=0AWaiting for reply.=0A=0AThanks,=0A= Sandep=0A=0A