From: Sandeep Khandelwal <sandeep_khandelwal27@yahoo.com>
To: pgsql-interfaces@postgresql.org
Subject: Bulk Load and Extract from PostgreSQL
Date: Tue, 17 Oct 2006 22:23:01 -0700 (PDT)
Message-ID: <20061018052301.34516.qmail@web33315.mail.mud.yahoo.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: sandeep_khandelwal27@yahoo.com
Subject: Re: Bulk Load and Extract from PostgreSQL
In-Reply-To: <20061018052301.34516.qmail@web33315.mail.mud.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox