From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Baffled by basic permission issue.
Date: Wed, 16 Jun 2021 22:58:41 +0200
Message-ID: <3AD88617-B7E7-4AF5-AE0B-05A79F88C2CC@jakobs.com> (raw)
In-Reply-To: <CAOC+FBV5TxsJ4CHTo60TYGDNU0Y1eM=XzrzHJNmSgpyFLdmqMg@mail.gmail.com>
References: <CAOC+FBV5TxsJ4CHTo60TYGDNU0Y1eM=XzrzHJNmSgpyFLdmqMg@mail.gmail.com>
If you want to use a view, you need the permissions for it. Not for the underlying tables
Am 16. Juni 2021 22:56:17 MESZ schrieb Wells Oliver <wells.oliver@gmail.com>:
>I have a view that does this:
>
>create view stats.v
>select * from stats.t
>join alias.i ON t.id = i.id
>join alias.i2 ON t.id2 = i2.id;
>
>And when I do: SELECT * FROM stats.v I receive: *ERROR: permission
>denied
>for table i*
>
>However, if I paste the contents of the view as a query and run it
>manually, it works fine.
>
>I can also query alias.i as I please.
>
>The role I am using to connect has USAGE on both stats and alias, it
>also
>has SELECT on the table as well as the view.
>
>The only difference is that the view is owned by a different user than
>the
>tables, though the SELECT permissions are definitely granted.
>
>psql 13.2
>
>--
>Wells Oliver
>wells.oliver@gmail.com <wellsoliver@gmail.com>
--
Holger Jakobs, Bergisch Gladbach
+49 178 9759012
- sent from mobile, therefore short -
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-admin@postgresql.org
Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
Subject: Re: Baffled by basic permission issue.
In-Reply-To: <3AD88617-B7E7-4AF5-AE0B-05A79F88C2CC@jakobs.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