Received: from hobbit.3logic.net (hobbit.3logic.net [195.38.16.2]) by postgresql.org (8.11.3/8.11.4) with SMTP id fAN7usm06712 for ; Fri, 23 Nov 2001 02:56:55 -0500 (EST) (envelope-from andriy.pyrozhenko@vanjaonline.com) Received: (qmail 13386 invoked from network); 23 Nov 2001 09:56:53 +0200 Received: (qmail: 1.03); 23 Nov 2001 07:56:53 -0000 Received: from onetim.3logic.net (HELO mail.vanjaonline.com) (195.38.17.73) by hobbit.3logic.net with SMTP; 23 Nov 2001 09:56:50 +0200 Received: from PYROZHENKO ([192.168.1.10]) by mail.vanjaonline.com (WinRoute Pro 4.1.29) with SMTP; Fri, 23 Nov 2001 09:55:17 +0200 Date: Fri, 23 Nov 2001 09:55:13 +0200 From: Andriy Pyrozhenko X-Mailer: The Bat! (v1.53bis) Reply-To: Andriy Pyrozhenko X-Priority: 3 (Normal) Message-ID: <1424171808.20011123095513@vanjaonline.com> To: pgsql-sql@postgresql.org Subject: Re: Question In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200111/335 X-Sequence-Number: 5717 Hello Christopher, >> I don't need delete record from jobs when I delete record from >> activity. But I need delete record from activity when I delete the >> record from jobs and I need to find this job_id in activities table! >> What must I do? >> >> CKL> Question: Why don't you just set up a foreign key that will >> achieve exactly >> CKL> the same thing without using RULEs? >> >> CKL> ie. ALTER TABLE activities ADD FOREIGN KEY (job_id) >> REFERENCES jobs(job_id) >> CKL> ON DELETE CASCADE; CKL> My ALTER TABLE statement above will do exactly this. CKL> It will delete activities when a job is deleted. Try it in a test database. But also need delete activities! -- Best regards, Andriy mailto:andriy.pyrozhenko@vanjaonline.com