Обсуждение: Re: [GENERAL] COPY with default values won't work?

Поиск
Список
Период
Сортировка

Re: [GENERAL] COPY with default values won't work?

От
"K.T."
Дата:
Or instead of eating tons of memory inserting all those record in one
transaction (you might want to commit every hundred or so...), copy then
issue an update to set the default values.
-----Original Message-----
From: Charles Tassell <ctassell@isn.net>
To: Vadim Mikheev <vadim@krs.ru>
Cc: pgsql-general@postgreSQL.org <pgsql-general@postgreSQL.org>
Date: Wednesday, March 24, 1999 12:45 AM
Subject: Re: [GENERAL] COPY with default values won't work?


>@#$#!!  Any way to make COPY use default, or shove a lot of data in with a
>single INSERT query?  According to older messages in the mailing list, it
>is *possible*, but I can't get it to work.
>
>My problem is that I might be using this to put a few thousand entries in
>the db every night, and when I last attempted this using a few thousand
>insert statements, it was awfully slow (on the order of taking HOURS)
>
>BTW: Thanks for the quick response.  I send the mail, answer some messages,
>and get a response.  Quicker than a Microsoft $0.95/min help line. :-)
>
>At 01:24 AM 3/24/99, you wrote:
>>This is standard behaviour. DEFAULT is for INSERT only,
>>when attribute is not specified in INSERT' target list.
>>
>>Vadim
>
>



Re: [GENERAL] COPY with default values won't work?

От
Vadim Mikheev
Дата:
"K.T." wrote:
>
> Or instead of eating tons of memory inserting all those record in one
                ^^^^^^^^^^^^^^^^^^^^^
I think this was fixed ~ 1.5-2 years ago...

> transaction (you might want to commit every hundred or so...), copy then
> issue an update to set the default values.

Oh, no. Remember that Postgres is non-overwriting storage system.

Vadim

Re: [GENERAL] COPY with default values won't work?

От
Oleg Broytmann
Дата:
On Wed, 24 Mar 1999, Vadim Mikheev wrote:
> > Or instead of eating tons of memory inserting all those record in one
> I think this was fixed ~ 1.5-2 years ago...

   I have the same problem in 6.4.2. I splitted COPY into small chunks
(about 500 rows) to overcome this.
   I beleive Jan fixed this in 6.5-beta a month ago.

> Vadim
>

Oleg.
----
    Oleg Broytmann     http://members.xoom.com/phd2/     phd2@earthling.net
           Programmers don't die, they just GOSUB without RETURN.