mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
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.
This commit is contained in:
@ -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">
|
||||
|
Reference in New Issue
Block a user