Re: Unable to execute \copy from Client Application

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Unable to execute \copy from Client Application
Дата
Msg-id 4F3D34E8.9070900@hogranch.com
обсуждение исходный текст
Ответ на Re: Unable to execute \copy from Client Application  (sujayr06 <sujayr06@gmail.com>)
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: sodik
Дата:
Сообщение: Check if backup is in progress
Следующее
От: "Andrus"
Дата:
Сообщение: How to recover data from cluster