Re: Is it necessary to have index for child table in following case? - Mailing list pgsql-general

From Yan Cheng Cheok
Subject Re: Is it necessary to have index for child table in following case?
Date
Msg-id 287298.83978.qm@web65706.mail.ac4.yahoo.com
Whole thread Raw
In response to Re: Is it necessary to have index for child table in following case?  (Joe Conway <mail@joeconway.com>)
Responses Re: Is it necessary to have index for child table in following case?  (Joe Conway <mail@joeconway.com>)
List pgsql-general
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
columncontains 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
makeserial 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 <mail@joeconway.com> wrote:

> From: Joe Conway <mail@joeconway.com>
> Subject: Re: [GENERAL] Is it necessary to have index for child table in following case?
> To: "Yan Cheng Cheok" <yccheok@yahoo.com>
> Cc: "Alban Hertroys" <dalroi@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
>
>





pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why lots of temp schemas are being created
Next
From: Joe Conway
Date:
Subject: Re: Is it necessary to have index for child table in following case?