postgresql/src/include
Alvaro Herrera 8b08f7d482 Local partitioned indexes
When CREATE INDEX is run on a partitioned table, create catalog entries
for an index on the partitioned table (which is just a placeholder since
the table proper has no data of its own), and recurse to create actual
indexes on the existing partitions; create them in future partitions
also.

As a convenience gadget, if the new index definition matches some
existing index in partitions, these are picked up and used instead of
creating new ones.  Whichever way these indexes come about, they become
attached to the index on the parent table and are dropped alongside it,
and cannot be dropped on isolation unless they are detached first.

To support pg_dump'ing these indexes, add commands
    CREATE INDEX ON ONLY <table>
(which creates the index on the parent partitioned table, without
recursing) and
    ALTER INDEX ATTACH PARTITION
(which is used after the indexes have been created individually on each
partition, to attach them to the parent index).  These reconstruct prior
database state exactly.

Reviewed-by: (in alphabetical order) Peter Eisentraut, Robert Haas, Amit
	Langote, Jesper Pedersen, Simon Riggs, David Rowley
Discussion: https://postgr.es/m/20171113170646.gzweigyrgg6pwsg4@alvherre.pgsql
2018-01-19 11:49:22 -03:00
..
access Update copyright for 2018 2018-01-02 23:30:12 -05:00
bootstrap Update copyright for 2018 2018-01-02 23:30:12 -05:00
catalog Local partitioned indexes 2018-01-19 11:49:22 -03:00
commands Local partitioned indexes 2018-01-19 11:49:22 -03:00
common Implement channel binding tls-server-end-point for SCRAM 2018-01-04 15:29:50 -05:00
datatype Update copyright for 2018 2018-01-02 23:30:12 -05:00
executor Expression evaluation based aggregate transition invocation. 2018-01-09 13:25:38 -08:00
fe_utils Update copyright for 2018 2018-01-02 23:30:12 -05:00
foreign Update copyright for 2018 2018-01-02 23:30:12 -05:00
lib Update copyright for 2018 2018-01-02 23:30:12 -05:00
libpq Implement channel binding tls-server-end-point for SCRAM 2018-01-04 15:29:50 -05:00
mb Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes Local partitioned indexes 2018-01-19 11:49:22 -03:00
optimizer Update copyright for 2018 2018-01-02 23:30:12 -05:00
parser Local partitioned indexes 2018-01-19 11:49:22 -03:00
port Remove outdated/removed Win32 URLs in C comments 2018-01-09 18:33:21 -05:00
portability Update copyright for 2018 2018-01-02 23:30:12 -05:00
postmaster Update copyright for 2018 2018-01-02 23:30:12 -05:00
regex Update copyright for 2018 2018-01-02 23:30:12 -05:00
replication Ability to advance replication slots 2018-01-17 11:38:34 +00:00
rewrite Update copyright for 2018 2018-01-02 23:30:12 -05:00
snowball Update copyright for 2018 2018-01-02 23:30:12 -05:00
statistics Update copyright for 2018 2018-01-02 23:30:12 -05:00
storage Allow ConditionVariable[PrepareTo]Sleep to auto-switch between CVs. 2018-01-09 11:39:10 -05:00
tcop Update copyright for 2018 2018-01-02 23:30:12 -05:00
tsearch Update copyright for 2018 2018-01-02 23:30:12 -05:00
utils Fix compiler warnings due to commit cc4feded 2018-01-17 03:33:02 -05:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
fmgr.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
funcapi.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
getaddrinfo.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
getopt_long.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Add statistics subdirectory to Makefile. 2017-06-08 11:29:50 -04:00
miscadmin.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_config.h.in Another attempt at fixing build with various OpenSSL versions 2018-01-04 19:09:27 -05:00
pg_config.h.win32 Provide overflow safe integer math inline functions. 2017-12-12 16:55:37 -08:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_getopt.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_trace.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgstat.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgtar.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgtime.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
port.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
postgres.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
rusagestub.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
windowapi.h Update copyright for 2018 2018-01-02 23:30:12 -05:00