Re: Rules in views, how to?

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: Andre Lopes <lopes80andre(at)gmail(dot)com>
Cc: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Re: Rules in views, how to?
Date: 2010-07-06 14:09:26
Message-ID: EF0D0D39-4F96-498D-8AB0-9E3D64A63D28@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 6 Jul 2010, at 13:03, Andre Lopes wrote:

> 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.

Unique is unique. There is no other record that could possibly be identified by the same unique identifier. It doesn't matter if you can identify the same record using other identifiers that are also unique, it's still a unique identifier. So if you have a unique identifier for your table you can use on the OLD row in the WHERE clause.

For example, if you have a primary key on that table you can use it to identify the records for the update. Whether that PK uses a simple unique index or a composite unique index doesn't matter at all either.

Alban Hertroys

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

!DSPAM:737,4c33391e286211703874864!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-07-06 14:22:14 Re: 'default nextval()' loses schema-qualification in dump ?
Previous Message Sam Mason 2010-07-06 13:12:33 Re: [SOLVED] Rules in views, how to?