Re: count (*)

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: count (*)
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C2360F1C@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на count (*)  (alonso <test895@gmail.com>)
Список pgsql-general
alonso wrote:
> I've got it, but I don't know the reason of it.
> In the database table the records have duplicated and I've
> two rows for
> every primary key - with different OIDs.
> Very strange however...

Very strange indeed.

Are you positive that there is a primary key constraint on
the column? Can you show some evidence?

> Is there any safe method to get rid of only one of each
> duplicated row?

If "id" is your "primary key":

DELETE FROM test USING test a
WHERE test.id = a.id AND test.oid > a.oid;

Yours,
Laurenz Albe

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

Предыдущее
От: Troy Rasiah
Дата:
Сообщение: Re: Time Zone design issues
Следующее
От: "Josh Harrison"
Дата:
Сообщение: postgres catalog files problem