Search Postgresql Archives

Re: Unable to execute \copy from Client Application

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

 



On Thu, 2012-02-16 at 01:05 -0800, sujayr06 wrote:
> Hello,
> 
>                    Please find the usage of \copy and the corresponding API.
> 
>                    strPgSqlQuerybuf<<"\\copy hnb_registration FROM
> '/root/Sujay/hnbfile.txt' USING DELIMITERS ','";
> 
>                    pPostGresQueryResult = PQexecParams(pPgConnection,
> strPgSqlQuerybuf.str().c_str(),
>                                                 0,           // one param
>                                                 NULL,        // let the
> backend deduce param type
>                                                 NULL,
>                                                 NULL,        // don't need
> param lengths since text
>                                                 NULL,        // default to
> all text params
>                                                 0);
>                     ePostGresCmdExecStatus =
> PQresultStatus(pPostGresQueryResult) ;
> 
>                     Let me know if the usage has to be corrected. 

Once again, you cannot use the \copy metacommand. Use the COPY API from
libpq (http://www.postgresql.org/docs/9.1/interactive/libpq-copy.html).


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


-- 
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