Re: Unique is non unique; no nulls

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Unique is non unique; no nulls
Дата
Msg-id 87myvdvrwo.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Unique is non unique; no nulls  (cbrazvan@laitek.com)
Список pgsql-general
<cbrazvan@laitek.com> writes:

> Hmm... maybe this will help: in the same function (i.e. transaction), I am
> also doing an update on the same table, using suid as update key, that is:
> update migratek.mt set sdate = smth where suid = s.suid;

Do the rows in the output to the second query I sent (the one with the large
output you attached) look like the "before" and "after" for one of these
updates?

> Can this - performing an update on a table from within the (same) table
> populating transaction that was not yet commited - throw off postgress in
> some way? Especially given the large number of tuples inserted (2.7
> million)

It certainly shouldn't. I'm still a bit skeptical that you really have a
unique index on the table. Perhaps there was an error when you created it and
you didn't notice? Or perhaps the index was dropped at some point later? Can
you send the table description including the list of indexes to be sure?

> Right now, my inclination is to rewrite the function, separating the
> updates from the inserts and see if that works.

I know the pressure to get something that works can be pretty high, but in the
long term I think it would be better to know exactly what happened here.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

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

Предыдущее
От: cbrazvan@laitek.com
Дата:
Сообщение: Re: Unique is non unique; no nulls
Следующее
От: Razvan Costea-Barlutiu
Дата:
Сообщение: Re: Unique is non unique; no nulls