X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CD19C566DF for ; Thu, 17 Mar 2005 14:35:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 52547-06 for ; Thu, 17 Mar 2005 14:34:56 +0000 (GMT) Received: from mail43-s.fg.online.no (mail43-s.fg.online.no [148.122.161.43]) by svr1.postgresql.org (Postfix) with ESMTP id B3ED1566DD for ; Thu, 17 Mar 2005 14:34:54 +0000 (GMT) Received: from [192.168.0.57] (062016240144.customer.alfanett.no [62.16.240.144]) by mail43.fg.online.no (8.12.11/8.12.11) with ESMTP id j2HEYwgC012460 for ; Thu, 17 Mar 2005 15:34:58 +0100 (CET) From: "Leif B. Kristensen" To: pgsql-sql@postgresql.org Subject: Re: update with subselect (long) Date: Thu, 17 Mar 2005 15:34:57 +0100 User-Agent: KMail/1.7.2 References: <200503171407.11017.leif@solumslekt.org> <20050317055420.S10944@megazone.bigpanda.com> In-Reply-To: <20050317055420.S10944@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503171534.58027.leif@solumslekt.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.238 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/245 X-Sequence-Number: 20724 On Thursday 17 March 2005 15:01, Stephan Szabo wrote: > The above needs some work. The below should be acceptable to the > system. > > update name_parts set name_part_type=5 from (select name_id from > name_parts where name_part_type=6) as gpt_type where > name_parts.name_id=gpt_type.name_id and name_part_type=3; Thank you very much! > I'm a bit worried about blindly changing the type for anything that > has a name_part_type=6 record, but given your usage that might be > okay. Yes, this is a kind of one-shot job. I shall be going through all the records manually later and correct the ones that don't fit the bill exactly. -- Leif Biberg Kristensen http://solumslekt.org/