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

From Sam Mason
Subject Re: [SOLVED] Rules in views, how to?
Date
Msg-id 20100706114608.GR7584@samason.me.uk
Whole thread Raw
In response to Re: [SOLVED] Rules in views, how to?  (Andre Lopes <lopes80andre@gmail.com>)
Responses Re: [SOLVED] Rules in views, how to?
List pgsql-general
On Tue, Jul 06, 2010 at 12:28:35PM +0100, Andre Lopes wrote:
> Ok, I have done the UPDATE RULE like this and works!

> where
> (id = OLD.id or username = OLD.username or email = OLD.email)

I'm pretty sure you just want to be using the id column above.  Using an
OR expression as you're doing could have some strange side effects.

You may also want to consider a UNIQUE constraint on the username (and
maybe email) fields as well, especially as you've said they should be
able to be used to uniquely determine a user.

--
  Sam  http://samason.me.uk/

pgsql-general by date:

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