Re: COPY command details

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: COPY command details
Дата
Msg-id 20070329080332.GF2338@a-kretschmer.de
обсуждение исходный текст
Ответ на COPY command details  (Benjamin Arai <benjamin@araisoft.com>)
Ответы Re: COPY command details
Re: COPY command details
Re: COPY command details
Список pgsql-general
am  Thu, dem 29.03.2007, um  0:13:09 -0700 mailte Benjamin Arai folgendes:
> Hi,
>
> If I have a PostgreSQL table with records and logical indexes already
> created, if I use COPY to load additional data, does the COPY update
> the indexes during, after, or not at all?

after, i think.

test=# create table foo (id int primary key, name text);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo"
CREATE TABLE
test=*# copy foo from stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
>> 1    a
>> 2    b
>> 2    c
>> \.
ERROR:  duplicate key violates unique constraint "foo_pkey"
CONTEXT:  COPY foo, line 3: "2  c"
test=*#


I can type the wrong key and the error occurs later with the finaly \.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

В списке pgsql-general по дате отправления:

Предыдущее
От: Stéphane Schildknecht
Дата:
Сообщение: Timestamp precision
Следующее
От: Toke Høiland-Jørgensen
Дата:
Сообщение: Btree indexes, large numbers and <= comparisons