Re: how to create rule as on delete

From: "Stewart Ben (RBAU/EQS4) *" <Ben(dot)Stewart(at)au(dot)bosch(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: how to create rule as on delete
Date: 2005-10-25 02:45:43
Message-ID: E253BDD7F008244585AEE87AF8F0224F116C7B16@cl-mail01.au.bosch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> If I add the DO INSTEAD,the record can be inserted
> into 'maytable_log' and also still remain in the table
> 'maytable'. Which is exactly not exist at all. It just
> show it as im using the DO INSTEAD.
>
> My problem is, how to insert the deleted record into
> table 'mytable_log' without showing it in table
> 'maytable'. I really need the solution..please

Add a DELETE clause on the table 'maytable' as part of the DO INSTEAD,
after the INSERT INTO.

Or, IIRC, you could INSERT INTO (without the DO INSTEAD) with the
variable NEW - the NEW variable will store the row being deleted.

Best regards,

Ben Stewart

--
Robert Bosch (Australia) Pty. Ltd.
Engineering Quality Services, Student Software Engineer (RBAU/EQS4)
Locked Bag 66 - Clayton South, VIC 3169 - AUSTRALIA
Tel: +61 3 9541-7002 Fax: +61 3 9541-7700
mailto:ben(dot)stewart(at)au(dot)bosch(dot)com
http://www.bosch.com.au/

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Glaesemann 2005-10-25 02:49:03 Re: SQL language
Previous Message Stewart Ben (RBAU/EQS4) * 2005-10-25 02:43:00 Re: automatic update or insert