kind of RULE on SELECT depending on existence of a WHERE condition

Поиск
Список
Период
Сортировка
От rawi
Тема kind of RULE on SELECT depending on existence of a WHERE condition
Дата
Msg-id 27741669.post@talk.nabble.com
обсуждение исходный текст
Ответы Re: kind of RULE on SELECT depending on existence of a WHERE condition  (Richard Huxton <dev@archonet.com>)
placement of stored procedures and contrib modules  (Michael Gould <mgould@intermodalsoftwaresolutions.net>)
Список pgsql-sql
Hi
please help me with the following scenario:

I'd gladly have all persons (contacts, customers, staff etc) in one table
"people" with some distinctive flags.

My reason for this, is that simple contacts could become customers or even
staff, staff members could be in the same time also customers etc and I
would  be glad to manage all the data in one table to avoid the same
Person-Record in three tables.

Now, the SELECTs would be generated from an application (hibernate)
automatically inserting some WHERE condition on the flags of the recorded
people depending on the rights of the user.
Some isn't allowed to see staff, an other shouldn't see customers etc.

But - for the case, that an application-programmer or even I (tired, middle
in the night) forget to program the insertion of the needed limiting WHERE
condition - it would be great to have some sort of rule ON SELECT, so a
SELECT without WHERE on the flags would return NOTHING.

Is there a way to achieve this?

Thank you for reading and hoping my problem can be solved.

Rawi

-- 
View this message in context:
http://old.nabble.com/kind-of-RULE-on-SELECT-depending-on-existence-of-a-WHERE-condition-tp27741669p27741669.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



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

Предыдущее
От: Michael Gould
Дата:
Сообщение: Re: Issue with insert
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: kind of RULE on SELECT depending on existence of a WHERE condition