Bulk Load and Extract from PostgreSQL - Mailing list pgsql-interfaces

From Sandeep Khandelwal
Subject Bulk Load and Extract from PostgreSQL
Date
Msg-id 20061018052301.34516.qmail@web33315.mail.mud.yahoo.com
Whole thread Raw
List 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.
Alsowant 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
rowat 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
knowhow 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
onerow 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
convertall the datatypes into string representation, especially BYTEA. 

Waiting for reply.

Thanks,
Sandep




pgsql-interfaces by date:

Previous
From: "Francisco Figueiredo Jr."
Date:
Subject: Npgsql 1.0 Released!!
Next
From: Marko Bozikovic
Date:
Subject: Postgres OLE DB provider - query parameters