pgsql: Don't create pg_type entries for sequences or toast tables.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Don't create pg_type entries for sequences or toast tables.
Дата
Msg-id E1jstVB-0005YS-Uh@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Don't create pg_type entries for sequences or toast tables.

Commit f7f70d5e2 left one inconsistency behind: we're still creating
pg_type entries for the composite types of sequences and toast tables,
but not arrays over those composites.  But there seems precious little
reason to have named composite types for toast tables, and not much more
to have them for sequences (especially given the thought that sequences
may someday not be standalone relations at all).

So, let's close that inconsistency by removing these composite types,
rather than adding arrays for them.  This buys back a little bit of
the initial pg_type bloat added by the previous patch, and could be
a significant savings in a large database with many toast tables.

Aside from a small logic rearrangement in heap_create_with_catalog,
this patch mostly needs to clean up some places that were assuming that
pg_class.reltype always has a valid value.  Those are really pre-existing
bugs, given that it's documented otherwise; notably, the plpgsql changes
fix code that gives "cache lookup failed for type 0" on indexes today.
But none of these seem interesting enough to back-patch.

Also, remove the pg_dump/pg_upgrade infrastructure for propagating
a toast table's pg_type OID into the new database, since we no longer
need that.

Discussion: https://postgr.es/m/761F1389-C6A8-4C15-80CE-950C961F5341@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f3faf35f370f558670c8213a08f2683f3811ffc7

Modified Files
--------------
doc/src/sgml/catalogs.sgml                 |  3 +-
src/backend/catalog/heap.c                 | 75 +++++++++++++++++-------------
src/backend/catalog/toasting.c             | 20 +-------
src/backend/commands/tablecmds.c           | 22 ++++-----
src/backend/nodes/makefuncs.c              |  6 ++-
src/backend/utils/adt/pg_upgrade_support.c | 11 -----
src/backend/utils/cache/relcache.c         | 13 +++---
src/bin/pg_dump/pg_dump.c                  | 46 +++++-------------
src/include/catalog/binary_upgrade.h       |  1 -
src/include/catalog/catversion.h           |  2 +-
src/include/catalog/pg_proc.dat            |  4 --
src/pl/plpgsql/src/pl_comp.c               | 22 ++++++++-
12 files changed, 102 insertions(+), 123 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Morph pg_replication_slots.min_safe_lsn to safe_wal_size
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Un-break pg_upgrade from pre-v12 servers.