postgresql/src/backend/commands
Alvaro Herrera 55ed3defc9 Fix partitioned index creation with foreign partitions
When a partitioned tables contains foreign tables as partitions, it is
not possible to implement unique or primary key indexes -- but when
regular indexes are created, there is no reason to do anything other
than ignoring such partitions.  We were raising errors upon encountering
the foreign partitions, which is unfriendly and doesn't protect against
any actual problems.

Relax this restriction so that index creation is allowed on partitioned
tables containing foreign partitions, becoming a no-op on them.  (We may
later want to redefine this so that the FDW is told to create the
indexes on the foreign side.)  This applies to CREATE INDEX, as well as
ALTER TABLE / ATTACH PARTITION and CREATE TABLE / PARTITION OF.

Backpatch to 11, where indexes on partitioned tables were introduced.

Discussion: https://postgr.es/m/15724-d5a58fa9472eef4f@postgresql.org
Author: Álvaro Herrera
Reviewed-by: Amit Langote
2019-06-26 18:38:51 -04:00
..
aggregatecmds.c Implement OR REPLACE option for CREATE AGGREGATE. 2019-03-19 01:16:50 +00:00
alter.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
amcmds.c Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
analyze.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
async.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
cluster.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
collationcmds.c Collations with nondeterministic comparison 2019-03-22 12:12:43 +01:00
comment.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
constraint.c Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
conversioncmds.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
copy.c Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
createas.c tableam: Rename wrapper functions to match callback names. 2019-05-23 16:32:36 -07:00
dbcommands.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
define.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
discard.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
dropcmds.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
event_trigger.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
explain.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
extension.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
foreigncmds.c Fix error messages 2019-05-08 13:20:16 -04:00
functioncmds.c Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
indexcmds.c Fix partitioned index creation with foreign partitions 2019-06-26 18:38:51 -04:00
lockcmds.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
Makefile Move vacuumlazy.c into access/heap. 2019-01-15 12:06:19 -08:00
matview.c tableam: Rename wrapper functions to match callback names. 2019-05-23 16:32:36 -07:00
opclasscmds.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
operatorcmds.c Fix style violations in syscache lookups. 2019-05-05 13:10:07 -04:00
policy.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
portalcmds.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
prepare.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
proclang.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
publicationcmds.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
schemacmds.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
seclabel.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
sequence.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
statscmds.c Rework the pg_statistic_ext catalog 2019-06-16 01:20:31 +02:00
subscriptioncmds.c Fix typo in message 2019-05-28 17:36:14 -04:00
tablecmds.c Fix partitioned index creation with foreign partitions 2019-06-26 18:38:51 -04:00
tablespace.c Don't access catalogs to validate GUCs when not connected to a DB. 2019-06-10 23:34:50 -07:00
trigger.c tableam: Rename wrapper functions to match callback names. 2019-05-23 16:32:36 -07:00
tsearchcmds.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
typecmds.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
user.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
vacuum.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
variable.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
view.c Fix CREATE VIEW to allow zero-column views. 2019-02-17 12:37:31 -05:00