Skip to content

Commit 0aeb5ae

Browse files
committed
Silence compiler warning on an unused variable
Also, tweak wording in comments (per Andres) and documentation (myself) to point out that it's the database's default tablespace that can be passed as 0, not DEFAULTTABLESPACE_OID. Robert Haas noticed the bug in the code, but didn't update the accompanying prose.
1 parent f01d1ae commit 0aeb5ae

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

doc/src/sgml/func.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15814,8 +15814,8 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1581415814
<para>
1581515815
<function>pg_filenode_relation</> is the reverse of
1581615816
<function>pg_relation_filenode</>. Given a <quote>tablespace</> OID and
15817-
a <quote>filenode</> it returns the associated relation. The default
15818-
tablespace can be specified as 0.
15817+
a <quote>filenode</>, it returns the associated relation's OID. For a table
15818+
in the database's default tablespace, the tablespace can be specified as 0.
1581915819
</para>
1582015820

1582115821
</sect2>

src/backend/utils/adt/dbsize.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,13 +760,14 @@ pg_relation_filenode(PG_FUNCTION_ARGS)
760760
* Get the relation via (reltablespace, relfilenode)
761761
*
762762
* This is expected to be used when somebody wants to match an individual file
763-
* on the filesystem back to its table. Thats not trivially possible via
764-
* pg_class because that doesn't contain the relfilenodes of shared and nailed
763+
* on the filesystem back to its table. That's not trivially possible via
764+
* pg_class, because that doesn't contain the relfilenodes of shared and nailed
765765
* tables.
766766
*
767767
* We don't fail but return NULL if we cannot find a mapping.
768768
*
769-
* Instead of knowing DEFAULTTABLESPACE_OID you can pass 0.
769+
* InvalidOid can be passed instead of the current database's default
770+
* tablespace.
770771
*/
771772
Datum
772773
pg_filenode_relation(PG_FUNCTION_ARGS)

src/backend/utils/cache/relfilenodemap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ RelidByRelfilenode(Oid reltablespace, Oid relfilenode)
210210

211211
while (HeapTupleIsValid(ntp = systable_getnext(scandesc)))
212212
{
213-
bool isnull;
213+
bool isnull PG_USED_FOR_ASSERTS_ONLY;
214214

215215
if (found)
216216
elog(ERROR,

0 commit comments

Comments
 (0)