Re: ALTER TABLESPACE ... MOVE ALL TO ...

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: ALTER TABLESPACE ... MOVE ALL TO ...
Дата
Msg-id CA+U5nM+u2rV8kZ9Lk7kMXExupg61u1ds_abpREKj3a81Z5Y=3A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ALTER TABLESPACE ... MOVE ALL TO ...  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: ALTER TABLESPACE ... MOVE ALL TO ...  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
On 20 January 2014 14:24, Stephen Frost <sfrost@snowman.net> wrote:
> * Simon Riggs (simon@2ndQuadrant.com) wrote:
>> The command uses the word ALL but then less than all objects, i.e.
>> only moves objects that are owned by the user.
>
> My thinking was that it was "all" from that user's perspective.
>
>> I would like to see two variants of this...
>>
>> ALL ... which attempts to move all objects and fails if it doesn't own
>> everything
>> ALL OWNED ... which moves only objects that it owns, and ignores others
>
> I could add that, though it feels like the next request would be to
> allow a specific role to be passed in (ie: move all of *this* user's
> objects) and I'm not sure we really need to go to that level.  It
> doesn't seem like there's really much point in having two options
> either- "ALL OWNED" run by the superuser would be identical to "ALL" and
> normal users would have zero use for just "ALL" because it would either
> be identical to "ALL OWNED" or it would fail with a permission denied
> error.
>
> If an extra noise word to clarify what is happening would be useful,
> then I could simply require "OWNED" as well, but I'm not particularly
> thrilled with that option, also ...
>
>> i.e. ALL should mean all
>
> This is a bit of a non-starter when it comes to tablespaces anyway- we
> can't move another database's objects and so even if it was "ALL", it
> may only be moving a subset of the objects in the tablespace (namely
> those which are in the current database).  I don't see it being an
> improvement to require "IN CURRENT DATABASE ALL OWNED" even though it
> would be more accurate.

Not a good argument since IN CURRENT DATABASE applies to all SQL
commands, so would clearly be unnecessary.

At the moment, ALL does not include all objects. It's a POLA violation
to have a command affect just some objects and not others. That is
especially confusing when the command run as Superuser *will* move all
objects and a RC of zero has different meaning dependent upon who the
user is that executes the command.

-- Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: array_length(anyarray)
Следующее
От: Florian Pflug
Дата:
Сообщение: Re: [PATCH] Negative Transition Aggregate Functions (WIP)