pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rawi <only4com@web.de>
To: pgsql-sql@postgresql.org
Subject: kind of RULE on SELECT depending on existence of a WHERE condition
Date: Mon, 1 Mar 2010 02:07:08 -0800 (PST)
Message-ID: <27741669.post@talk.nabble.com> (raw)


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-tp27741669p...
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.




view thread (6+ messages)  latest in thread

Message-ID: <27741669.post@talk.nabble.com>
Permalink:  ../27741669.post@talk.nabble.com/
Also on:    postgresql.org/message-id/27741669.post@talk.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: only4com@web.de
  Subject: Re: kind of RULE on SELECT depending on existence of a WHERE condition
  In-Reply-To: <27741669.post@talk.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox