agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: intmail01@gmail.com <intmail01@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Jayadevan M <maymala.jayadevan@gmail.com>
Cc: pgsql-sql@lists.postgresql.org
Subject: Re: Hide some tables
Date: Mon, 9 Aug 2021 17:48:56 +0000
Message-ID: <0470ef60-6bd9-5b71-c666-f26ab65ef8d1@gmail.com> (raw)
In-Reply-To: <3360703.1628516757@sss.pgh.pa.us>
References: <2a4f55f7-b8fb-4937-9136-c7e35de63f79@gmail.com>
	<CAFS1N4j8tEDap7sEeZDsQPSCbrFZwjbRYmyTAYPBA+yMP+2_CA@mail.gmail.com>
	<3360703.1628516757@sss.pgh.pa.us>

Le 09/08/2021 à 13:45, Tom Lane a écrit :
> Jayadevan M <maymala.jayadevan@gmail.com> writes:
>> There are some operators who enters data in my database with just one
>>> table. Others tables are updated by triggers, these tables contains
>>> result of calculation. How to do to hide these tables because I do not
>>> want that operators read them ? On help documentation it is said that I
>>> can not block SELECT privilege because it is required for UPDATE.
>>>
>> Can you move them to a different schema, and manage using search_path?
> The thing to use is privileges.  Make the tables-that-should-be-hidden
> owned by a different SQL role, and don't give select privilege on them
> to the data entry role.  The triggers can be (or call) SECURITY DEFINER
> functions owned by the first role, giving them access that the data entry
> role does not have.
>
> 			regards, tom lane

It works. Thank you






view thread (4+ messages)

Message-ID: <0470ef60-6bd9-5b71-c666-f26ab65ef8d1@gmail.com>
Permalink:  ../0470ef60-6bd9-5b71-c666-f26ab65ef8d1@gmail.com/
Also on:    postgresql.org/message-id/0470ef60-6bd9-5b71-c666-f26ab65ef8d1@gmail.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: intmail01@gmail.com, tgl@sss.pgh.pa.us, maymala.jayadevan@gmail.com, pgsql-sql@lists.postgresql.org
  Subject: Re: Hide some tables
  In-Reply-To: <0470ef60-6bd9-5b71-c666-f26ab65ef8d1@gmail.com>

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

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