Search Postgresql Archives

Re: self-referential UPDATE problem on 7.4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Karsten Hilbert <Karsten.Hilbert@xxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux