Re: [GENERAL] Update field to a column from another table

2016-04-21 Thread drum.lu...@gmail.com
The problem was a trigger in my DB, when I disabled it the data started to be updated. Lucas

Re: [GENERAL] Update field to a column from another table

2016-04-21 Thread Adrian Klaver
On 04/21/2016 11:52 AM, drum.lu...@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 = t1.id AND t2.time_job IS DISTINCT FROM t1.time_job; I get: UPDATE 2202 So I check the data

Re: [GENERAL] Update field to a column from another table

2016-04-21 Thread David G. Johnston
On Thursday, April 21, 2016, drum.lu...@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 = t1.id >> AND t2.time_job IS DISTINCT FROM t1.time_job; > > > I get: > > UPDATE 2202 > > So I check the data by doing: > > select *

Re: [GENERAL] Update field to a column from another table

2016-04-21 Thread drum.lu...@gmail.com
So when I run: 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; 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

Re: [GENERAL] Update field to a column from another table

2016-04-21 Thread David G. Johnston
Please don't top-post. > > -Original Message- > > From: pgsql-general-ow...@postgresql.org [mailto: > pgsql-general-ow...@postgresql.org] On Behalf Of > > drum.lu...@gmail.com > > Sent: Donnerstag, 21. April 2016 07:10 > > To: Postgres General &g

Re: [GENERAL] Update field to a column from another table

2016-04-20 Thread Charles Clavadetscher
Donnerstag, 21. April 2016 07:10 > To: Postgres General > Subject: [GENERAL] Update field to a column from another table > > I've got two tables: > > - ja_jobs > - junk.ja_jobs_23856 > > I need to update the null column ja_jobs.time_job with the data from the

[GENERAL] Update field to a column from another table

2016-04-20 Thread drum.lu...@gmail.com
I've got two tables: - ja_jobs - junk.ja_jobs_23856 I need to update the null column ja_jobs.time_job with the data from the table junk.ja_jobs_23856 So I'm doing: > > UPDATE public.ja_jobs AS b > SET time_job = a.time_job > FROM junk.ja_jobs_23856 AS a > WHERE a.id = b.id > AND a.clientid =