Search Postgresql Archives

Re: Enforcing Join condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



சிவகுமார் மா 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/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux