Received: from omega.bkc.lv (omega.bkc.lv [195.244.128.2]) by hub.org (8.9.2/8.9.1) with ESMTP id JAA68502 for ; Fri, 5 Mar 1999 09:29:08 -0500 (EST) (envelope-from emils@mail.usis.bkc.lv) Received: from mail.usis.bkc.lv (mail.usis.bkc.lv [195.244.132.2]) by omega.bkc.lv (8.9.1/8.9.1) with ESMTP id QAA04937 for ; Fri, 5 Mar 1999 16:29:05 +0200 (EEST) Message-Id: <199903051429.QAA04937@omega.bkc.lv> Received: from USIS-RIGA/SpoolDir by mail.usis.bkc.lv (Mercury 1.44); 5 Mar 99 16:31:25 EET Received: from SpoolDir by USIS-RIGA (Mercury 1.44); 5 Mar 99 16:31:16 EET From: "Emils Klotins" Organization: USIS Riga To: pgsql-sql@postgresql.org Date: Fri, 5 Mar 1999 16:31:08 EET MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Hello & create rule question Reply-to: emils@mail.usis.bkc.lv Priority: normal X-mailer: Pegasus Mail for Win32 (v3.02b14) Hello! I have just joined this mailing list, so please do not become frustrated, if I happen to ask something that has already been answered recently. There is a thing, which didn't work as I expected, so maybe you could tell me, what have I done wrong? There are 2 tables: museums (museum_id int2, description text, address_id int2) addresses (address_id int2, address text); (they are actually a bit different, the museums.museum_id & address.address_id being unique indices with default values from sequences etc.) I want to delete museum's address from addresses when I delete something from museums. So I thought to do it with a rule: CREATE RULE museumdel ON DELETE TO museums DO DELETE FROM addresses WHERE addresses.address_id=current.address_id; Now, when I do DELETE FROM museums, the psql monitor displays DELETE 0 and when I check the tables, the proper entry from museums IS deleted, but the associated addresses row is not.  What am I doing wrong? Thanks in advance for any ideas & tips! Emils Klotins e-mail: emils@mail.usis.bkc.lv Systems Manager URL: http://www.usis.bkc.lv/ USIS Riga 7 Smilsu Str., Riga LV1050, LATVIA ...................................................... RSA PGP key published on: http://pgpkeys.mit.edu:11371