mirror of
https://github.com/postgres/postgres.git
synced 2025-06-22 02:52:08 +03:00
Add TOAST table to pg_index.
This change allows pg_index rows to use out-of-line storage for the
"indexprs" and "indpred" columns, which enables use-cases such as
very large index expressions.
This system catalog was previously not given a TOAST table due to a
fear of circularity issues (see commit 96cdeae07f
). Testing has
not revealed any such problems, and it seems unlikely that the
entries for system indexes could ever need out-of-line storage. In
any case, it is still early in the v18 development cycle, so
committing this now will hopefully increase the chances of finding
any unexpected problems prior to release.
Bumps catversion.
Reported-by: Jonathan Katz
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/b611015f-b423-458c-aa2d-be0e655cc1b4%40postgresql.org
This commit is contained in:
@ -57,6 +57,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* yyyymmddN */
|
/* yyyymmddN */
|
||||||
#define CATALOG_VERSION_NO 202409181
|
#define CATALOG_VERSION_NO 202409182
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -69,6 +69,8 @@ CATALOG(pg_index,2610,IndexRelationId) BKI_SCHEMA_MACRO
|
|||||||
*/
|
*/
|
||||||
typedef FormData_pg_index *Form_pg_index;
|
typedef FormData_pg_index *Form_pg_index;
|
||||||
|
|
||||||
|
DECLARE_TOAST_WITH_MACRO(pg_index, 8149, 8150, PgIndexToastTable, PgIndexToastIndex);
|
||||||
|
|
||||||
DECLARE_INDEX(pg_index_indrelid_index, 2678, IndexIndrelidIndexId, pg_index, btree(indrelid oid_ops));
|
DECLARE_INDEX(pg_index_indrelid_index, 2678, IndexIndrelidIndexId, pg_index, btree(indrelid oid_ops));
|
||||||
DECLARE_UNIQUE_INDEX_PKEY(pg_index_indexrelid_index, 2679, IndexRelidIndexId, pg_index, btree(indexrelid oid_ops));
|
DECLARE_UNIQUE_INDEX_PKEY(pg_index_indexrelid_index, 2679, IndexRelidIndexId, pg_index, btree(indexrelid oid_ops));
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ WHERE refclassid = 0 OR refobjid = 0 OR
|
|||||||
-- Look for system tables with varlena columns but no toast table. All
|
-- Look for system tables with varlena columns but no toast table. All
|
||||||
-- system tables with toastable columns should have toast tables, with
|
-- system tables with toastable columns should have toast tables, with
|
||||||
-- the following exceptions:
|
-- the following exceptions:
|
||||||
-- 1. pg_class, pg_attribute, and pg_index, due to fear of recursive
|
-- 1. pg_class and pg_attribute, due to fear of recursive dependencies as
|
||||||
-- dependencies as toast tables depend on them.
|
-- toast tables depend on them.
|
||||||
-- 2. pg_largeobject and pg_largeobject_metadata. Large object catalogs
|
-- 2. pg_largeobject and pg_largeobject_metadata. Large object catalogs
|
||||||
-- and toast tables are mutually exclusive and large object data is handled
|
-- and toast tables are mutually exclusive and large object data is handled
|
||||||
-- as user data by pg_upgrade, which would cause failures.
|
-- as user data by pg_upgrade, which would cause failures.
|
||||||
@ -56,11 +56,9 @@ ORDER BY 1, 2;
|
|||||||
pg_class | relacl | aclitem[]
|
pg_class | relacl | aclitem[]
|
||||||
pg_class | reloptions | text[]
|
pg_class | reloptions | text[]
|
||||||
pg_class | relpartbound | pg_node_tree
|
pg_class | relpartbound | pg_node_tree
|
||||||
pg_index | indexprs | pg_node_tree
|
|
||||||
pg_index | indpred | pg_node_tree
|
|
||||||
pg_largeobject | data | bytea
|
pg_largeobject | data | bytea
|
||||||
pg_largeobject_metadata | lomacl | aclitem[]
|
pg_largeobject_metadata | lomacl | aclitem[]
|
||||||
(11 rows)
|
(9 rows)
|
||||||
|
|
||||||
-- system catalogs without primary keys
|
-- system catalogs without primary keys
|
||||||
--
|
--
|
||||||
|
@ -38,8 +38,8 @@ WHERE refclassid = 0 OR refobjid = 0 OR
|
|||||||
-- Look for system tables with varlena columns but no toast table. All
|
-- Look for system tables with varlena columns but no toast table. All
|
||||||
-- system tables with toastable columns should have toast tables, with
|
-- system tables with toastable columns should have toast tables, with
|
||||||
-- the following exceptions:
|
-- the following exceptions:
|
||||||
-- 1. pg_class, pg_attribute, and pg_index, due to fear of recursive
|
-- 1. pg_class and pg_attribute, due to fear of recursive dependencies as
|
||||||
-- dependencies as toast tables depend on them.
|
-- toast tables depend on them.
|
||||||
-- 2. pg_largeobject and pg_largeobject_metadata. Large object catalogs
|
-- 2. pg_largeobject and pg_largeobject_metadata. Large object catalogs
|
||||||
-- and toast tables are mutually exclusive and large object data is handled
|
-- and toast tables are mutually exclusive and large object data is handled
|
||||||
-- as user data by pg_upgrade, which would cause failures.
|
-- as user data by pg_upgrade, which would cause failures.
|
||||||
|
Reference in New Issue
Block a user