From: Stewart Ben (RBAU/EQS4) * <Ben.Stewart@au.bosch.com>
To: pgsql-sql@postgresql.org
Subject: Re: how to create rule as on delete
Date: Tue, 25 Oct 2005 12:45:43 +1000
Message-ID: <E253BDD7F008244585AEE87AF8F0224F116C7B16@cl-mail01.au.bosch.com> (raw)
> 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.stewart@au.bosch.com
http://www.bosch.com.au/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: Ben.Stewart@au.bosch.com
Subject: Re: how to create rule as on delete
In-Reply-To: <E253BDD7F008244585AEE87AF8F0224F116C7B16@cl-mail01.au.bosch.com>
References: <E253BDD7F008244585AEE87AF8F0224F116C7B16@cl-mail01.au.bosch.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox