From f01d1ae3a104019d6d68aeff85c4816a275130b3 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Mon, 22 Jul 2013 10:34:34 -0400 Subject: Add infrastructure for mapping relfilenodes to relation OIDs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- doc/src/sgml/func.sgml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 707d3034956..da63b347e58 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -15748,6 +15748,9 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); pg_relation_filepath + + pg_filenode_relation + Database Object Location Functions @@ -15776,6 +15779,15 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); File path name of the specified relation + + + pg_filenode_relation(tablespace oid, filenode oid) + + regclass + + Find the relation associated with a given tablespace and filenode + +
@@ -15799,6 +15811,13 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); the relation. + + pg_filenode_relation is the reverse of + pg_relation_filenode. Given a tablespace OID and + a filenode it returns the associated relation. The default + tablespace can be specified as 0. + + -- cgit v1.2.3