Re: self-referential UPDATE problem on 7.4

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: self-referential UPDATE problem on 7.4
Дата
Msg-id 17992.1167928595@sss.pgh.pa.us
обсуждение исходный текст
Ответ на self-referential UPDATE problem on 7.4  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Ответы Re: self-referential UPDATE problem on 7.4  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-general
Karsten Hilbert <Karsten.Hilbert@gmx.net> writes:
> I am trying to run this query in psql:

> update clin.episode
> set fk_patient = clin.health_issue.fk_patient
> from clin.health_issue
> where
>     clin.episode.fk_patient is NULL and
>     clin.episode.fk_health_issue = clin.health_issue.pk;

> It returns "UPDATE 2" which is what I expect from the data.
> However, the rows in question are not actually updated.

That seems very strange.  Could you perhaps have a BEFORE UPDATE trigger
that's changing the values back to null again?

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Table inheritance implementation.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Moving from 7.2.1 to 8.1.5 - looking for jdbc