Re: Why the ERROR: duplicate key violates uniqueconstraint "master_pkey" is raised? - Is this a Bug?

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: Why the ERROR: duplicate key violates uniqueconstraint "master_pkey" is raised? - Is this a Bug?
Дата
Msg-id 845531.88497.qm@web31812.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: Why the ERROR: duplicate key violates uniqueconstraint "master_pkey" is raised? - Is this a Bug?  ("Phoenix Kiula" <phoenix.kiula@gmail.com>)
Список pgsql-general
--- Phoenix Kiula <phoenix.kiula@gmail.com> wrote:

> Isn't this expected behavior? When you update the m2 of the first
> record, it becomes 2 and violates the unique constraint as the second
> row already has an m2 value of 2.

Well, it is a limitation PostgreSQL.  This type of update is should work without any problem
according to the SQL standard.   The Problem with performing two updates is that it double the
amount of dead tuples.  I guess that this would be another example where having a small fill
factor would help.

One kind of data model that depends heavily on this type of operation is the Hierarchical Nested
Set data model.  Inserting/updating/deleting nodes and branches into the table requires updating
the primary key of a lot of records.

Regards,
Richard Broersma Jr.

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

Предыдущее
От: Reece Hart
Дата:
Сообщение: Re: Why the ERROR: duplicate key violates uniqueconstraint "master_pkey" is raised? - Is this a Bug?
Следующее
От: "Phoenix Kiula"
Дата:
Сообщение: [Urgent] Regexp_replace question