* Simon Riggs (simon@2ndQuadrant.com) wrote:
> Not a good argument since IN CURRENT DATABASE applies to all SQL
> commands, so would clearly be unnecessary.
I suppose it depends on how you're looking at it.
ALTER TABLESPACE ... RENAME, for example, updates a shared catalog and
therefore the change is seen across all databases. That's not exactly
"IN CURRENT DATABASE".
> 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.
So you're still looking for an 'OWNED' noise word to be added? Also, I
did add the ability to specify types of objects (it's often that we'll
have a "INDEXES" tablespace, so this made sense), so how about:
ALTER TABLESPACE name MOVE OWNED TO name opt_nowait
ALTER TABLESPACE name MOVE TABLES OWNED TO name opt_nowait
ALTER TABLESPACE name MOVE INDEXES OWNED TO name opt_nowait
ALTER TABLESPACE name MOVE MATERIALIZED VIEWS OWNED TO name opt_nowait
Removing the 'ALL' entirely?
Should there be an "OWNED BY name_list" option also, since that's how we
use 'OWNED' elsewhere? Should the use of "OWNED" elsewhere (eg:
REASSIGN OWNED BY) also support just 'OWNED' to mean the current role
(I'm not entirely sure how much sense that makes, but figured I'd ask).
Thanks,
Stephen