Re: PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index

Поиск
Список
Период
Сортировка
От Wang, Mary Y
Тема Re: PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index
Дата
Msg-id FA20D4C4FEBFD148B1C0CB09913825FC01EBD530B3@XCH-SW-06V.sw.nos.boeing.com
обсуждение исходный текст
Ответ на Re: PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-general
Thanks Tom.
I still couldn't find that particular line that caused that problem :-(.  Counting was very pain.
Is there anyway that I can tell psql just to "ignore" (I mean don't insert it duplicate key into unique index
users_pkey)and just keep going without doing the PQendcopy:resetting connection? 

I've a dev server that has some portion of the database (I believe the duplicate problem also occurred in that
database),and that user_table is querable with data.  Would I be able to find any more detailed information of which
exactstatement caused that problem? 

Mary




-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Tom Lane
Sent: Wednesday, February 03, 2010 7:43 AM
To: Wang, Mary Y
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index

"Wang, Mary Y" <mary.y.wang@boeing.com> writes:
> I managed to restore my database. However, one table is not restored.
> The error message that I was received was "copy: line 3057, Cannot insert a duplicate key into unique index
users_pkey..."and then "...PQendcopy:resetting connection" 

> Then I went to the log file (my debug file was set to level 5),
> ProcessUtility: COPY "users"  FROM stdin;
> ERROR:  copy: line 3057, Cannot insert a duplicate key into unique index users_pkey"

> My question is that line #3057.  Do I count it from the line where it did "COPY "users" FROM stdin" as the first line
andcount up to 3057 lines (that line is the problem)? 

IIRC, even as far back as 7.1, that should be read as "the 3057'th row of COPY data for this table".  So you can count
forward3057 lines from the COPY command in the dump file ... unless you have any embedded newlines in your data, in
whichcase it could get a bit painful to count correctly. 

            regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

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

Предыдущее
От: Scott Frankel
Дата:
Сообщение: Re: add column specify position
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index