Search Postgresql Archives

Re: Unable to execute \copy from Client Application

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux