Received: from hobbit.3logic.net (hobbit.3logic.net [195.38.16.2]) by postgresql.org (8.11.3/8.11.4) with SMTP id fAKDe5m22747 for ; Tue, 20 Nov 2001 08:40:06 -0500 (EST) (envelope-from andriy.pyrozhenko@vanjaonline.com) Received: (qmail 7896 invoked from network); 20 Nov 2001 15:40:04 +0200 Received: (qmail: 1.03); 20 Nov 2001 13:40:04 -0000 Received: from onetim.3logic.net (HELO mail.vanjaonline.com) (195.38.17.73) by hobbit.3logic.net with SMTP; 20 Nov 2001 15:40:03 +0200 Received: from PYROZHENKO ([192.168.1.10]) by mail.vanjaonline.com (WinRoute Pro 4.1.29) with SMTP; Tue, 20 Nov 2001 15:38:45 +0200 Date: Tue, 20 Nov 2001 15:38:45 +0200 From: Andriy Pyrozhenko X-Mailer: The Bat! (v1.53bis) Reply-To: Andriy Pyrozhenko X-Priority: 3 (Normal) Message-ID: <7524444939.20011120153845@vanjaonline.com> To: pgsql-sql@postgresql.org Subject: Rule MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200111/292 X-Sequence-Number: 5674 Hello pgsql-sql, I have the rule for table CREATE RULE del_jobs_del_activity AS ON DELETE TO jobs DO DELETE FROM activities WHERE job_id = OLD.job_id; When i call: DELETE FROM jobs WHERE job_id IN (SELECT DISTINCT job_id FROM activities WHERE load_no = 123) This query does not delete the record from jobs but delete the record by rule. What must I change for work this query correctly? Best regards, Andriy mailto:andriy.pyrozhenko@vanjaonline.com