Re: Update violating constraint

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: Update violating constraint
Дата
Msg-id 194540.41655.qm@web31810.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: Update violating constraint  (Naz Gassiep <naz@mira.net>)
Ответы Re: Update violating constraint  (Csaba Nagy <nagy@ecircle-ag.com>)
Список pgsql-general
> > update foo
> > set field = -1 * (field + 1);
> > update foo
> > set field = -1 * field
> > where field < 0;
> >
> Yes, in fact I actually use option one already in the handling of sql
> trees, so I'm annoyed with myself for not figuring that out. I don't
> know why you'd ever use your second option ever, as it virtually
> guarantees problems at a random point in your DB's growth.


If you are updating a large portion of your tree, you will probably want to throw in a vacuum in
between the two updates.  This should reduce the bloat caused by dead tuples in both your index
and table.

Regards,
Richard Broersma Jr.

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

Предыдущее
От: Stephen Harris
Дата:
Сообщение: Re: Have I b0rked something? Slow comparisons on "where x in (...)"
Следующее
От: Csaba Nagy
Дата:
Сообщение: Re: Update violating constraint