Re: Enforcing Join condition

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Enforcing Join condition
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C28E331A@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на Re: Enforcing Join condition  ("சிவகுமார் மா"<masivakumar@gmail.com>)
Список pgsql-general
சிவகுமார் மா 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

В списке pgsql-general по дате отправления:

Предыдущее
От: "சிவகுமார் மா"
Дата:
Сообщение: Re: Enforcing Join condition
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: PLpgsql debugger question