Re: Is it necessary to have index for child table in following case?

From: Yan Cheng Cheok <yccheok(at)yahoo(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>, pgsql-general(at)postgresql(dot)org
Subject: Re: Is it necessary to have index for child table in following case?
Date: 2010-02-04 02:59:59
Message-ID: 287298.83978.qm@web65706.mail.ac4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 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 <mail(at)joeconway(dot)com> wrote:

> From: Joe Conway <mail(at)joeconway(dot)com>
> Subject: Re: [GENERAL] Is it necessary to have index for child table in following case?
> To: "Yan Cheng Cheok" <yccheok(at)yahoo(dot)com>
> Cc: "Alban Hertroys" <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>, pgsql-general(at)postgresql(dot)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
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2010-02-04 03:46:43 Re: Is it necessary to have index for child table in following case?
Previous Message Tom Lane 2010-02-04 02:35:50 Re: Why lots of temp schemas are being created