pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Can user specification of a column value be required when querying a view ?
Date: Sat, 25 Nov 2023 10:49:42 +0100
Message-ID: <20231125094942.p3vdynfg2slsn2ok@hjp.at> (raw)
In-Reply-To: <CANzqJaBwVqMJoZEYjhqQjSW+EQNnv7aNy7vyLZiDszBUWm_Xsg@mail.gmail.com>
References: <CAEs=6DmkV_hd+c9OVK4yCuedsrjO0_ZD6tnDRw5OdCC=eMh2vg@mail.gmail.com>
	<1E154B80-1BF2-478A-987A-F28F58A4D1A8@thebuild.com>
	<73acc1a178aa851f6f5a424d6874a157ca0db2f7.camel@lists.simkin.ca>
	<CANzqJaCcfpS+65ygYfmV9fUqHMrJXzt8r_pmo5hmoK+JxNBOLg@mail.gmail.com>
	<20231124180056.k4ea6or6clngrkaq@hjp.at>
	<CANzqJaBwVqMJoZEYjhqQjSW+EQNnv7aNy7vyLZiDszBUWm_Xsg@mail.gmail.com>

On 2023-11-24 13:06:45 -0500, Ron Johnson wrote:
> On Fri, Nov 24, 2023 at 1:01 PM Peter J. Holzer <hjp-pgsql@hjp.at> wrote:
>     On 2023-11-20 22:03:06 -0500, Ron Johnson wrote:
>     > Or row level security.
> 
>     Does that help here? AIUI row level security can be used to limit access
>     to specific rows (e.g. user alex can access info about ssn '106-91-9930'
>     but not '234-56-7890') but not how many rows can be accessed in a single
>     query.
> 
> 
> I don't think OP indicated that ssn in a unique key. 

No he didn't, but that's IMHO not relevant to the possibility of using
row level security. If a row level security allows a user to select a
row, that row can be selected by any query, including «select * from t».
I don't see a way to use RLS to ensure that a query can only return a
sufficiently small subset of the total rows a user has access to.
How would you do that?

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (11+ messages)  latest in thread

Message-ID: <20231125094942.p3vdynfg2slsn2ok@hjp.at>
Permalink:  ../20231125094942.p3vdynfg2slsn2ok@hjp.at/
Also on:    postgresql.org/message-id/20231125094942.p3vdynfg2slsn2ok@hjp.at

 · 

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-general@postgresql.org
  Cc: hjp-pgsql@hjp.at
  Subject: Re: Can user specification of a column value be required when querying a view ?
  In-Reply-To: <20231125094942.p3vdynfg2slsn2ok@hjp.at>
  References: <CAEs=6DmkV_hd+c9OVK4yCuedsrjO0_ZD6tnDRw5OdCC=eMh2vg@mail.gmail.com> <1E154B80-1BF2-478A-987A-F28F58A4D1A8@thebuild.com> <73acc1a178aa851f6f5a424d6874a157ca0db2f7.camel@lists.simkin.ca> <CANzqJaCcfpS+65ygYfmV9fUqHMrJXzt8r_pmo5hmoK+JxNBOLg@mail.gmail.com> <20231124180056.k4ea6or6clngrkaq@hjp.at> <CANzqJaBwVqMJoZEYjhqQjSW+EQNnv7aNy7vyLZiDszBUWm_Xsg@mail.gmail.com> <20231125094942.p3vdynfg2slsn2ok@hjp.at>

* 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