Re: Update violating constraint

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Update violating constraint
Дата
Msg-id 20070503152401.GG4218@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Update violating constraint  (Alban Hertroys <alban@magproductions.nl>)
Ответы Re: Update violating constraint  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-general
Alban Hertroys wrote:
> Richard Huxton wrote:
> > Alban Hertroys wrote:
> >> Naz Gassiep wrote:
> >>> Hi,
> >>>     I'm trying to do an update on a table that has a unique constraint
> >>> on the field, I need to update the table by setting field = field+1
> >
> >> I think you're looking for deferrable constraints; see:
> >>
> >> http://www.postgresql.org/docs/8.2/static/sql-set-constraints.html
> >
> > Which won't work with unique constraints unfortunately. That's because
> > they're implemented through a unique index.
>
> I appreciate the complexities involved, but that really ought to work on
> a single statement. I recall seeing something along these lines on the
> TODO list some time ago?

It is still on the TODO list.  If you want it to disappear from there,
your best bet is implementing a fix, followed by motivating someone to
do it for you.  If you don't, bets are someone will do it eventually
(which may be too late for your taste).

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: "Martin Gainty"
Дата:
Сообщение: Re: C functions under windows
Следующее
От: Thorsten Kraus
Дата:
Сообщение: Re: Stored procedure