diff options
author | Robert Haas <rhaas@postgresql.org> | 2013-07-22 10:34:34 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2013-07-22 11:09:10 -0400 |
commit | f01d1ae3a104019d6d68aeff85c4816a275130b3 (patch) | |
tree | a0fa034de5d28f5eb458bba87c6ed6e5a163bd37 /doc/src | |
parent | b3b10c39038c20457ef058c7f4e5589c28a84f1c (diff) | |
download | postgresql-f01d1ae3a104019d6d68aeff85c4816a275130b3.tar.gz postgresql-f01d1ae3a104019d6d68aeff85c4816a275130b3.zip |
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.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 19 |
1 files changed, 19 insertions, 0 deletions
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()); <indexterm> <primary>pg_relation_filepath</primary> </indexterm> + <indexterm> + <primary>pg_filenode_relation</primary> + </indexterm> <table id="functions-admin-dblocation"> <title>Database Object Location Functions</title> @@ -15776,6 +15779,15 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); File path name of the specified relation </entry> </row> + <row> + <entry> + <literal><function>pg_filenode_relation(<parameter>tablespace</parameter> <type>oid</type>, <parameter>filenode</parameter> <type>oid</type>)</function></literal> + </entry> + <entry><type>regclass</type></entry> + <entry> + Find the relation associated with a given tablespace and filenode + </entry> + </row> </tbody> </tgroup> </table> @@ -15799,6 +15811,13 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); the relation. </para> + <para> + <function>pg_filenode_relation</> is the reverse of + <function>pg_relation_filenode</>. Given a <quote>tablespace</> OID and + a <quote>filenode</> it returns the associated relation. The default + tablespace can be specified as 0. + </para> + </sect2> <sect2 id="functions-admin-genfile"> |