Re: Rules in views, how to? - Mailing list pgsql-general

From Andre Lopes
Subject Re: Rules in views, how to?
Date
Msg-id AANLkTimTBP2Gp0Rnj0qjaw2-wO_qSoK6P92FuTQ2nM8u@mail.gmail.com
Whole thread Raw
In response to Re: Rules in views, how to?  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Responses Re: [SOLVED] Rules in views, how to?  (Andre Lopes <lopes80andre@gmail.com>)
Re: Rules in views, how to?  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List pgsql-general
Hi Alban,

But in my application I have more than one way of uniquely identify the record. Could be by the email field or by the id field.

Thera are update that are done by the WHERE email clause and other by the WHERE id clause.

It is possible to deal with this?

Best Regards,




On Tue, Jul 6, 2010 at 11:54 AM, Alban Hertroys <dalroi@solfertje.student.utwente.nl> wrote:
On 6 Jul 2010, at 12:28, Andre Lopes wrote:

> Now I need also to add an INSTEAD UPDATE rule and an INSTEAD DELETE rule, but I have some doubts about it... let me explain...
>
> Ok, I need to create an INSTEAD UPDATE rule in this view, but I don't know how to use the clause WHERE in the UPDATE rule. For example the UPDATE could be done when "WHERE email = 'X' " or "WHERE id = 'Y' ".
>
> Question: How can I deal with this?


In the WHERE-clause you use the columns from the OLD record that uniquely identify that record.

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:921,4c330b7e286211912975436!



pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Rules in views, how to?
Next
From: Andre Lopes
Date:
Subject: Re: [SOLVED] Rules in views, how to?