On Fri, Apr 21, 2017 at 1:43 AM, Stephen Frost <sfrost@snowman.net> wrote:
>> + Once
>> + partitions exist, we do not support using <literal>ONLY</literal> to
>> + add or drop constraints on only the partitioned table.
>>
>> I wonder if the following sounds a bit more informative: Once partitions
>> exist, using <literal>ONLY</literal> will result in an error, because the
>> constraint being added or dropped must be added or dropped from the
>> partitions too.
>
> My thinking here is that we may add support later on down the line for
> using the ONLY keyword, when the constraint has already been created on
> the partitions themselves, so I would rather just clarify that we don't
> (yet) support that. Your wording, at least to me, seems to imply that
> if the constraint was added to or dropped from the partitions then the
> ONLY keyword could be used, which isn't accurate today.
Well, I think that Amit's wording has the virtue of giving a reason
which is basically valid, whereas someone reading your text might
conceivably be left wondering what the reason for the restriction is.
Also, I think saying that it it will result in an error is a bit more
helpful than saying that it is is not supported, since the latter
might lead someone to believe that it could result in undefined
behavior (i.e. arbitrarily awful misbehavior) which is not the case.
So I like what he wrote, for whatever that's worth.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company