On 04/21/2016 11:52 AM, drum.lucas@gmail.com wrote:
> So when I run:
>
> UPDATE ja_jobs t2
> SET time_job = t1.time_job
> FROM junk.ja_test t1
> WHERE t2.id <http://t2.id> = t1.id <http://t1.id>
> AND t2.time_job IS DISTINCT FROM t1.time_job;
>
>
> I get:
>
> UPDATE 2202
>
> So I check the data by doing:
>
> select * FROM public.ja_jobs WHERE id = 14574527
>
>
> And the "time_job" field is null....
First idea:
Are you doing this in two different sessions at the same time, so
something like this?:
Session 1
BEGIN;
UPDATE ja_jobs t2
SET time_job = t1.time_job
FROM junk.ja_test t1
WHERE t2.id = t1.id
AND t2.time_job IS DISTINCT FROM t1.time_job;
Session 2
select * FROM public.ja_jobs WHERE id = 14574527
Where Session 2 is not seeing the UPDATE in Session 1 because the
transaction has not been COMMITed.
Second idea:
Does id = 14574527 meet the criteria AND t2.time_job IS DISTINCT FROM
t1.time_job?
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com