On 09/07/2015 05:25 AM, Kyotaro HORIGUCHI wrote:
> Hello,
>
>> but making the COLUMN
>> required is certainly much worse as it breaks many existing scripts. The
>> keyword inky breaks cases that manipulate "statistics" column.
>
> Ouch! It is simply by accident, or my lack of carefulness. I will
> come up with fixed syntax later..
>
>> If any of this is unacceptable, then we probably need to come up with a
>> different syntax.
I've been thinking about the syntax, and I think both options (making
COLUMN required or making STATISTICS a reserved keyword) will break
something no matter what we do, forcing the users to either always use
ADD COLUMN or quote all the existing uses of "statistics" (as column
names, for example).
Maybe the best solution is to abandon the ALTER TABLE approach entirely,
and instead invent a new set of commands
CREATE STATISTICS DROP STATISTICS
(ALTER STATISTICS seems a bit excessive at this point).
Another thing is that perhaps we should add names for statistics, just
like we do for constraints, for example. Otherwise the DROP STATISTICS
handling is rather awkward - for example if the user creates stats twice
by mistake, he's unable to drop just one of them.
regards
--
Tomas Vondra http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services