pgsql: Add infrastructure for mapping relfilenodes to relation OIDs.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add infrastructure for mapping relfilenodes to relation OIDs.
Date: 2013-07-22 15:12:08
Message-ID: E1V1HmS-0005M3-41@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/f01d1ae3a104019d6d68aeff85c4816a275130b3

Modified Files
--------------
doc/src/sgml/func.sgml | 19 +++
src/backend/utils/adt/dbsize.c | 28 ++++
src/backend/utils/cache/Makefile | 3 +-
src/backend/utils/cache/inval.c | 2 +-
src/backend/utils/cache/relfilenodemap.c | 247 +++++++++++++++++++++++++++++
src/backend/utils/cache/relmapper.c | 53 +++++++
src/include/catalog/catversion.h | 2 +-
src/include/catalog/indexing.h | 2 +
src/include/catalog/pg_proc.h | 2 +
src/include/utils/builtins.h | 1 +
src/include/utils/relfilenodemap.h | 18 +++
src/include/utils/relmapper.h | 2 +
src/test/regress/expected/alter_table.out | 18 +++
src/test/regress/sql/alter_table.sql | 14 ++
14 files changed, 408 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2013-07-22 17:19:09 pgsql: Silence compiler warning on an unused variable
Previous Message Tom Lane 2013-07-20 16:45:14 pgsql: Fix error handling in PLy_spi_execute_fetch_result().