Re: Unable to execute \copy from Client Application

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Unable to execute \copy from Client Application
Дата
Msg-id 1329379881.2255.0.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Unable to execute \copy from Client Application  (sujayr06 <sujayr06@gmail.com>)
Ответы Re: Unable to execute \copy from Client Application  (sujayr06 <sujayr06@gmail.com>)
Re: Unable to execute \copy from Client Application  (sujayr06 <sujayr06@gmail.com>)
Список pgsql-general
On Thu, 2012-02-16 at 00:07 -0800, sujayr06 wrote:
> Hello All,
>
>            My application is a C++ APP.
>
>            I'm executing \copy command from the CPP and its as follows
>
>            strPgSqlQuerybuf<<"\\copy hnb_registration FROM
> '/root/Sujay/hnbfile.txt' USING DELIMITERS ','";
>
>            Second \ is to keep the compiler happy. When this command
> executes on PostGreSql,
>            gives a syntax error as
>
>            ERROR:  syntax error at or near "\" at character 1
>            STATEMENT:  \copy hnb_registration FROM '/root/Sujay/hnbfile.txt'
> USING DELIMITERS ','
>
>            Can some please help!
>

\copy is a psql metacommand, not a SQL command. You cannot use it in
your application. You need to use the libpq API.


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com


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

Предыдущее
От: sujayr06
Дата:
Сообщение: Unable to execute \copy from Client Application
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: Drop big index