Re: BUG #8512: Can't use columns I can't read in the where clause of a select

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: BUG #8512: Can't use columns I can't read in the where clause of a select
Дата
Msg-id 20131008190200.GE2706@tamriel.snowman.net
обсуждение исходный текст
Ответ на BUG #8512: Can't use columns I can't read in the where clause of a select  (kurt@roeckx.be)
Ответы Re: BUG #8512: Can't use columns I can't read in the where clause of a select  (David Johnston <polobo@yahoo.com>)
Список pgsql-bugs
* kurt@roeckx.be (kurt@roeckx.be) wrote:
>     Allows SELECT from any column, or the specific columns listed, of the
> specified table, view, or sequence. Also allows the use of COPY TO. This
> privilege is also needed to reference existing column values in UPDATE or
> DELETE.
>=20
>=20
> I read that as "SELECT field1 from table where field2 =3D 1" should work =
if I
> have grant select(field1), but not on field2.  I'm getting a "permission
> denied".  If I remove the where clause it of course works.

You have to have SELECT rights on a column to be able to use it in a
conditional (eg: with WHERE).

> I'm not sure if the behaviour is expected or not.  Maybe I'm reading the
> documentation wrong, or maybe the documentation is just wrong.  Could
> someone please clarify?

It's expected.  The documentation could perhaps be improved, but the
second sentence ("This privilege is also needed..") is intended to cover
the case where the column is being referred to *anywhere* in the query,
basically, and that applies to SELECT as much as UPDATE or DELETE.

    Thanks,

        Stephen

В списке pgsql-bugs по дате отправления:

Предыдущее
От: kurt@roeckx.be
Дата:
Сообщение: BUG #8512: Can't use columns I can't read in the where clause of a select
Следующее
От: David Johnston
Дата:
Сообщение: Re: BUG #8512: Can't use columns I can't read in the where clause of a select