Robert Haas wrote:
> On Wed, Feb 15, 2017 at 9:37 AM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
> > Joshua D. Drake wrote:
> >> Because partitions may have data.
> >
> > So would the table, were it not partitioned.
>
> True. I think the question here is: do we want to view the dependency
> between a partitioned table and a partition of that table as
> DEPENDENCY_NORMAL or as DEPENDENCY_AUTO? With table inheritance, it's
> always been "normal" and I'm not sure there's any good reason for
> partitioning to make the opposite decision.
I think new-style partitioning is supposed to consider each partition as
an implementation detail of the table; the fact that you can manipulate
partitions separately does not really mean that they are their own
independent object. You don't stop to think "do I really want to drop
the TOAST table attached to this main table?" and attach a CASCADE
clause if so. You just drop the main table, and the toast one is
dropped automatically. I think new-style partitions should behave
equivalently.
You can make the partition an independent entity, but if you don't
explicitly take that step beforehand, I don't see why we should see it
that way implicitly.
> The new partitioning
> implementation provides a user experience that is overall smoother
> than doing the same thing with inheritance, but it's not as if you can
> ignore the fact that your partitioned tables have sub-objects that are
> also tables.
Now that partitions are declarative, the underlying implementation could
change away from inheritance. It's now just an implementation artifact.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services