Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [GENERAL] Enforcing Join condition

From: Albe Laurenz <laurenz.albe(at)wien.gv.at>
Date: Thu Nov 15 2007 - 09:31:08 EST


சிவகுமார் மா wrote:
>> You want to have a "conditional" foreign key reference that checks
>> against different tables depending on a "type" field, right?
>>
>> For complicated conditions like this, you could use a
>> BEFORE INSERT trigger that throws an error when the condition
>> is violated.

> 
> That we do. My query is to put a check on select queries to avoid
> programmers not using all the necessary conditions.

You can create a view that does the join the correct way (maybe a UNION of two different joins) and give the programmers access to that view, but not to the underlying tables.

Yours,
Laurenz Albe

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/ Received on Thu Nov 15 09:36:14 2007

This archive was generated by hypermail 2.1.8 : Mon Jun 16 2008 - 19:55:02 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library