Bulk Load and Extract from PostgreSQL

From: Sandeep Khandelwal <sandeep_khandelwal27(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Bulk Load and Extract from PostgreSQL
Date: 2006-10-18 05:23:01
Message-ID: 20061018052301.34516.qmail@web33315.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi All.

I 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 delete and update into PostgreSQL using Libpq API.

PLease let me know

Read -
I am planning to use COPY DATA TO command in TEXT mode for reading, I am using PQgetCopydata function to get data one row at a time.
Problem -
a - Not sure whether PQgetCopydata will give NULL terminated string or \n terminated string.
b - I know that PQgetCopydata API will give data 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 BYTEA.
c - Don't know what are the special characters and how these are handeled by PQgetCopydata and How I should hendel them.

Load -
I am planning to use COPY DATA FROM command in TEXT mode for writing, I am using PQputCopydata function to send data one row at a time.
Problem -
a - Not sure what are the special characters and how I should miodify them.
b - PQputCopydata API takes data of all the rows, seperated by delimiter, ini string representation. Don't know how to convert all the datatypes into string representation, especially BYTEA.

Waiting for reply.

Thanks,
Sandep

Browse pgsql-interfaces by date

  From Date Subject
Next Message Marko Bozikovic 2006-10-18 07:06:32 Postgres OLE DB provider - query parameters
Previous Message Francisco Figueiredo Jr. 2006-10-17 13:33:36 Npgsql 1.0 Released!!