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

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER TABLESPACE ... MOVE ALL TO ...
Date: 2014-01-20 13:24:36
Message-ID: 20140120132435.GH31026@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Simon Riggs (simon(at)2ndQuadrant(dot)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.

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2014-01-20 13:29:42 Re: array_length(anyarray)
Previous Message Marko Tiikkaja 2014-01-20 13:05:42 Re: plpgsql.warn_shadow