]> granicus.if.org Git - postgresql/commit
Add infrastructure for mapping relfilenodes to relation OIDs.
authorRobert Haas <rhaas@postgresql.org>
Mon, 22 Jul 2013 14:34:34 +0000 (10:34 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 22 Jul 2013 15:09:10 +0000 (11:09 -0400)
commitf01d1ae3a104019d6d68aeff85c4816a275130b3
treea0fa034de5d28f5eb458bba87c6ed6e5a163bd37
parentb3b10c39038c20457ef058c7f4e5589c28a84f1c
Add infrastructure for mapping relfilenodes to relation OIDs.

Future patches are expected to introduce logical replication that
works by decoding WAL.  WAL contains relfilenodes rather than relation
OIDs, so this infrastructure will be needed to find the relation OID
based on WAL contents.

If logical replication does not make it into this release, we probably
should consider reverting this, since it will add some overhead to DDL
operations that create new relations.  One additional index insert per
pg_class row is not a large overhead, but it's more than zero.
Another way of meeting the needs of logical replication would be to
the relation OID to WAL, but that would burden DML operations, not
only DDL.

Andres Freund, with some changes by me.  Design review, in earlier
versions, by Álvaro Herrera.
14 files changed:
doc/src/sgml/func.sgml
src/backend/utils/adt/dbsize.c
src/backend/utils/cache/Makefile
src/backend/utils/cache/inval.c
src/backend/utils/cache/relfilenodemap.c [new file with mode: 0644]
src/backend/utils/cache/relmapper.c
src/include/catalog/catversion.h
src/include/catalog/indexing.h
src/include/catalog/pg_proc.h
src/include/utils/builtins.h
src/include/utils/relfilenodemap.h [new file with mode: 0644]
src/include/utils/relmapper.h
src/test/regress/expected/alter_table.out
src/test/regress/sql/alter_table.sql