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

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: ALTER TABLESPACE ... MOVE ALL TO ...
Дата
Msg-id CA+U5nM+LQ6vy81LMQEQ_vx_TXpUwM-pURgxhO-gJxTgDdeNsGQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ALTER TABLESPACE ... MOVE ALL TO ...  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: ALTER TABLESPACE ... MOVE ALL TO ...  (Fujii Masao <masao.fujii@gmail.com>)
Список pgsql-hackers
On 20 January 2014 17:00, Stephen Frost <sfrost@snowman.net> wrote:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> What if you're a superuser and you want to move everybody's objects
>> (perhaps in preparation for dropping the tablespace)?  I think there's
>> value in both the ALL and OWNED forms.
>
> A superuser is considered to 'own' all objects and so 'ALL' and 'OWNED'
> above would be the same when issued by a superuser, in the current
> implementation.
>
> Looking at DROP OWNED and REASSIGN OWNED, they operate at the more
> specific level of "OWNED" == "relowner" rather than if the role is
> considered an 'owner' of the object through role membership, as you are
> implying above.
>
> As such, I'll rework this to be more in-line with the existing OWNED BY
> semantics of REASSIGN OWNED BY and DROP OWNED BY, which means we'd have:
>
> ALTER TABLESPACE name MOVE [ ALL | OWNED [ BY reluser ] ]
>     [ TABLES | INDEXES | MATERIALIZED VIEWS ] TO name opt_nowait
>
> eg:
>
> ALTER TABLESPACE tblspc1 MOVE ALL TO tblspc2;
> ALTER TABLESPACE tblspc1 MOVE OWNED TO tblspc2;
> ALTER TABLESPACE tblspc1 MOVE OWNED BY myrole TO tblspc2;
> ALTER TABLESPACE tblspc1 MOVE TABLES OWNED BY myrole TO tblspc2;
> ALTER TABLESPACE tblspc1 MOVE ALL OWNED BY myrole TO tblspc2;

Sounds great, thanks.

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



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Performance Improvement by reducing WAL for Update Operation
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: truncating pg_multixact/members