On 02/16/12 1:05 AM, sujayr06 wrote:
                    Please find the usage of \copy and the corresponding API.

                    strPgSqlQuerybuf<<"\\copy hnb_registration FROM
'/root/Sujay/hnbfile.txt' USING DELIMITERS ','";

The \ commands are all metacommands for the PSQL utility, none of it is SQL that can be sent as a query.

you need to use the plain sql 'COPY ... FROM STDIN' command, and use PQputCopyData() to send the data (eg, read your /root/Sujay/hnbfile.txt and send it to that API).


ugh, /root ?!?   Why is ROOT running *ANY* SQL at all ??

--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to