UPDATE across tables

From: "Jake Matchett" <Jake(dot)Matchett(at)nottingham(dot)ac(dot)uk>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: UPDATE across tables
Date: 2002-08-07 11:01:23
Message-ID: sd510c15.047@gwmail.nottingham.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I need to update the primary key field in two tables sharing this field,
I can't update separately because I get an integrity violation message
that tells me the field is still being referenced from the other table,
fair enough but is there any way of doing a joined/linked/double update
to the primary key of both tables simultaneously? Something like: UPDATE
table1.fieldx, table2.fieldx SET fieldx='yyyyy' WHERE fieldx='zzzzz';

Jake Matchett
The University of Nottingham
Media Centre
Medical School, Queen's Medical Centre
Nottingham NG7 2UH
(74) 44001
voice +44 (0) 115 9249924 ext 44001
fax +44 (0) 115 9709917
< http://www.nottingham.ac.uk/aves/ >

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jake Matchett 2002-08-07 11:09:14 UPDATE across tables
Previous Message Tom Lane 2002-08-07 03:48:53 Re: Novice