Skip site navigation (1) Skip section navigation (2)

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:09:14
Message-ID: sd510dee.000@gwmail.nottingham.ac.uk (view raw or flat)
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
 
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/ >

pgsql-novice by date

Next:From: Oliver ElphickDate: 2002-08-07 15:31:11
Subject: Re: UPDATE across tables
Previous:From: Jake MatchettDate: 2002-08-07 11:01:23
Subject: UPDATE across tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group