X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 3C1689DCA6E for ; Wed, 8 Feb 2006 13:35:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 95417-10 for ; Wed, 8 Feb 2006 13:35:18 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id E65569DC881 for ; Wed, 8 Feb 2006 13:35:16 -0400 (AST) Received: from nelson.osl.com (216-21-133-120.ip.van.radiant.net [216.21.133.120]) by svr4.postgresql.org (Postfix) with ESMTP id DE1765AF071 for ; Wed, 8 Feb 2006 17:35:16 +0000 (GMT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Subject: Re: Delete with join -- deleting related table entries? Date: Wed, 8 Feb 2006 09:35:14 -0800 Message-ID: <144D12D7DD4EC04F99241498BB4EEDCC20CC5A@nelson.osl.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] Delete with join -- deleting related table entries? Thread-Index: AcYs0yTjwft69upxR4aOmQji7ewuHQAAcGLQAABC3OA= From: "Owen Jacobson" To: "Owen Jacobson" , "Bryce Nesbitt" , X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.1 required=5 tests=[AWL=0.100, UPPERCASE_25_50=0] X-Spam-Score: 0.1 X-Spam-Level: X-Archive-Number: 200602/76 X-Sequence-Number: 24086 Owen Jacobson wrote: > BEGIN; > DELETE FROM note WHERE issue_id IN (SELECT issue_id FROM isuse > WHERE reservation_id =3D reservation_to_delete); > DELETE FROM isuse WHERE reservation_id =3D reservation_to_delete; > DELETE FROM reservations WHERE reservation_id =3D=20 > reservation_to_delete; > END; That should be COMMIT;, not END;. Been writing too much pl/pgsql. -Owen