Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 75FA29FA4CF for ; Tue, 17 Oct 2006 07:46:18 -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 21150-05 for ; Tue, 17 Oct 2006 07:46:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from NIHCESSMTP2.hub.nih.gov (nihcessmtp2.hub.nih.gov [128.231.90.116]) by postgresql.org (Postfix) with ESMTP id A68B49F9FAC for ; Tue, 17 Oct 2006 07:46:12 -0300 (ADT) Received: from nihcesmlbx10.nih.gov ([156.40.71.210]) by NIHCESSMTP2.hub.nih.gov with Microsoft SMTPSVC(6.0.3790.1830); Tue, 17 Oct 2006 06:46:11 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Re: Bulk Load and Extract from PostgreSQL Date: Tue, 17 Oct 2006 06:43:56 -0400 Message-ID: <014DBF86B19310419F0DF8910FC56457240CDE@nihcesmlbx10.nih.gov> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [INTERFACES] Bulk Load and Extract from PostgreSQL Thread-Index: AcbxriNiVVSEau+eRtSJ47o4e+66xAAKwHf4 References: <20061017053603.33289.qmail@web33309.mail.mud.yahoo.com> From: "Davis, Sean \(NIH/NCI\) [E]" To: "Sandeep Khandelwal" , X-OriginalArrivalTime: 17 Oct 2006 10:46:11.0311 (UTC) FILETIME=[75CB8FF0:01C6F1D9] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/13 X-Sequence-Number: 6296 Sandeep, Try looking here: http://www.postgresql.org/docs/8.1/interactive/libpq-exec.html Under "Escaping Binary Strings for Inclusion in SQL Commands"? Will = that satisfy your needs, or did I miss what you are trying to do? Sean -----Original Message----- From: Sandeep Khandelwal [mailto:sandeep_khandelwal27@yahoo.com] Sent: Tue 10/17/2006 1:36 AM To: Davis, Sean (NIH/NCI) [E]; pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] Bulk Load and Extract from PostgreSQL =20 Hi Sean. Thanks for the reply. I have one more question. While extracting data 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 loading data = into PostgreSQL ,using COPY FROM command in TEXT mode, with = PQputCopydata. But there is no API to convert binary data into it's = string representation. Could you tell me API or I am misinterpreting = something. Thanks in advance, Sandeep ----- Original Message ---- From: Sean Davis To: pgsql-interfaces@postgresql.org Cc: Sandeep Khandelwal Sent: Monday, October 16, 2006 4:04:45 PM Subject: Re: [INTERFACES] Bulk Load and Extract from PostgreSQL On Monday 16 October 2006 03:07, Sandeep Khandelwal wrote: > Hi All. > > I want to extract and Load data from PostgreSQL using Libpq C API. = Please > let me know which approach will be good to load large number of rows = into > PostgreSQL(Insert or COPY FROM) and, which approach will be good to = extract > large number of rows from PostgreSQL (COPY TO or SELECT). I want to = handle > all the data types supported in the PostgreSQL. copy is the faster way to go for a single table. =20 Sean ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match