Re: Tablespace permissions issue

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Tablespace permissions issue
Дата
Msg-id 26185.1088431165@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Tablespace permissions issue  (Gavin Sherry <swm@linuxworld.com.au>)
Список pgsql-hackers
Gavin Sherry <swm@linuxworld.com.au> writes:
> Chris KL just raised an issue on IRC:
> test=> create table test (a int4) tablespace pg_default;
> ERROR:  permission denied for tablespace pg_default

This is not a bug.  If you don't have tablespace permissions, you don't
get to specify where your table goes --- it gets put into the tablespace
that is default for your schema or database.  Which is not necessarily
pg_default.

You could possibly argue that pg_default ought to have world permissions
in the default setup, but I don't really see why.  Joe User probably
shouldn't be fooling with tablespaces at all.

> I guess that might have been a bit presumptuous but a similar thing
> happens if you don't specify a tablespace:

>         tablespaceId = get_namespace_tablespace(namespaceId);
>         /* note no permission check on tablespace in this case */

That's not a bug either.  The presumption is that whoever assigned a
default tablespace to your schema or database had the right to do so.
Users who just make use of that default don't need any extra
permissions.
        regards, tom lane


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

Предыдущее
От: Dennis Bjorklund
Дата:
Сообщение: Re: lock timeout patch
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Tablespace permissions issue