PostgreSQL 11.0 对分区表的功能进行了增强,其中支持在主表中声明索引,并在子表中自动创建。而在此之前,在主表中声明的索引是无效的,需要分别在子表中去建立索引:

There is no facility available to create the matching indexes on all partitions automatically. Indexes must be added to each partition with separate commands.
5.10. Table Partitioning