pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Heather Johnson <hjohnson@nypost.com>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] How to Prevent Certain Kinds of Joins?
Date: Tue, 22 Feb 2005 20:08:09 +0000
Message-ID: <421B9129.9060905@archonet.com> (raw)
In-Reply-To: <421B8D2D.6050800@nypost.com>
References: <421B8D2D.6050800@nypost.com>

Heather Johnson wrote:
> Is there a way to revoke permission to join two or more tables, even for 
> users who have all other permissions (e.g., select, insert, update, 
> delete) on those tables?

I don't think you can, and I'm not sure it makes sense to. If I can 
select from tables ta,tb then I can match them up in my client - if 
needs be I can save the data and import it into a local database.

Could you hide the column(s) being joined on? If so, then you could 
create two views and just grant access to those.
  CREATE TABLE ta (id_a int, notes_a text, joinval_a int)
  CREATE TABLE tb (id_b int, notes_b text, joinval_b int)
  CREATE VIEW va AS SELECT id_a,notes_a FROM ta
  CREATE VIEW vb AS SELECT id_b,notes_b FROM tb
  GRANT ALL ON VIEW va TO ...
  GRANT ALL ON VIEW vb TO ...
  REVOKE ALL ON TABLE ta FROM ...
  REVOKE ALL ON TABLE tb FROM ...
You'll want to add rules for updating/inserting, assuming that can be 
done while concealing the existence of joinval_a/b

-- 
   Richard Huxton
   Archonet Ltd



view thread (7+ messages)  latest in thread

Message-ID: <421B9129.9060905@archonet.com>
Permalink:  ../421B9129.9060905@archonet.com/
Also on:    postgresql.org/message-id/421B9129.9060905@archonet.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: dev@archonet.com, hjohnson@nypost.com, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] How to Prevent Certain Kinds of Joins?
  In-Reply-To: <421B9129.9060905@archonet.com>
  References: <421B8D2D.6050800@nypost.com> <421B9129.9060905@archonet.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