mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Get rid of pg_class.reltoastidxid.
Treat TOAST index just the same as normal one and get the OID of TOAST index from pg_index but not pg_class.reltoastidxid. This change allows us to handle multiple TOAST indexes, and which is required infrastructure for upcoming REINDEX CONCURRENTLY feature. Patch by Michael Paquier, reviewed by Andres Freund and me.
This commit is contained in:
@ -321,12 +321,19 @@ get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo)
|
||||
"INSERT INTO info_rels "
|
||||
"SELECT reltoastrelid "
|
||||
"FROM info_rels i JOIN pg_catalog.pg_class c "
|
||||
" ON i.reloid = c.oid"));
|
||||
" ON i.reloid = c.oid "
|
||||
" AND c.reltoastrelid != %u", InvalidOid));
|
||||
PQclear(executeQueryOrDie(conn,
|
||||
"INSERT INTO info_rels "
|
||||
"SELECT reltoastidxid "
|
||||
"FROM info_rels i JOIN pg_catalog.pg_class c "
|
||||
" ON i.reloid = c.oid"));
|
||||
"SELECT indexrelid "
|
||||
"FROM pg_index "
|
||||
"WHERE indisvalid "
|
||||
" AND indrelid IN (SELECT reltoastrelid "
|
||||
" FROM info_rels i "
|
||||
" JOIN pg_catalog.pg_class c "
|
||||
" ON i.reloid = c.oid "
|
||||
" AND c.reltoastrelid != %u)",
|
||||
InvalidOid));
|
||||
|
||||
snprintf(query, sizeof(query),
|
||||
"SELECT c.oid, n.nspname, c.relname, "
|
||||
|
Reference in New Issue
Block a user