Sorry. I do read your previous post.However, I ignore and soon forget quite a 
while, as I do not how to use it with the column contains serial

    PQexec(Database::instance().getConnection(), "copy unit_1 from stdin");
    // | serial | int | int 
    /* But I just do not want to put 9999 as serial. I want it to be 
auto-increment. However, I have no idea how to make serial auto-increment, 
without using INSERT.
    */
    PQputline(Database::instance().getConnection(),"9999\t1\t888\n");
    PQputline(Database::instance().getConnection(),"\\.\n");
    PQendcopy(Database::instance().getConnection());

Thanks and Regards
Yan Cheng CHEOK


--- On Thu, 2/4/10, Joe Conway <m...@joeconway.com> wrote:

> From: Joe Conway <m...@joeconway.com>
> Subject: Re: [GENERAL] Is it necessary to have index for child table in 
> following case?
> To: "Yan Cheng Cheok" <ycch...@yahoo.com>
> Cc: "Alban Hertroys" <dal...@solfertje.student.utwente.nl>, 
> pgsql-general@postgresql.org
> Date: Thursday, February 4, 2010, 9:08 AM
> On 02/03/2010 05:02 PM, Yan Cheng
> Cheok wrote:
> >> 
> >> Are you using INSERT or COPY to insert your data?
> COPY tends to be
> >> a lot faster than separate INSERTs, especially if
> you don't wrap
> >> the INSERTs in a transaction block and COMMIT them
> in batches.
> > 
> > But I do not use File or Stdio. The data is coming in
> row by row
> > real-time. I need to insert the data programmatic
> real-time into the
> > database. That's why I use INSERT. But maybe I miss
> out something on
> > the usage of COPY, please advice :)
> 
> I already answered that about a month ago but you ignored
> it:
> http://archives.postgresql.org/pgsql-general/2010-01/msg00287.php
> 
> Joe
> 
> 


      


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