]> granicus.if.org Git - postgresql/commitdiff
Silence compiler warning on an unused variable
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 22 Jul 2013 17:15:13 +0000 (13:15 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 22 Jul 2013 17:15:13 +0000 (13:15 -0400)
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.

doc/src/sgml/func.sgml
src/backend/utils/adt/dbsize.c
src/backend/utils/cache/relfilenodemap.c

index da63b347e58600864c28ad3a9db1a8455b8c9a19..039b279f78615e93903a5c055eaa39e4aa9c1e3b 100644 (file)
@@ -15814,8 +15814,8 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
    <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.
+       a <quote>filenode</>, it returns the associated relation's OID. For a table
+    in the database's default tablespace, the tablespace can be specified as 0.
    </para>
 
   </sect2>
index 21d1c946abe9c0959b4a5aec1165e2e88beddeb9..868474680df3384fd5ad280e72bc0cd4559acb55 100644 (file)
@@ -760,13 +760,14 @@ pg_relation_filenode(PG_FUNCTION_ARGS)
  * Get the relation via (reltablespace, relfilenode)
  *
  * This is expected to be used when somebody wants to match an individual file
- * on the filesystem back to its table. Thats not trivially possible via
- * pg_class because that doesn't contain the relfilenodes of shared and nailed
+ * on the filesystem back to its table. That's not trivially possible via
+ * pg_class, because that doesn't contain the relfilenodes of shared and nailed
  * tables.
  *
  * We don't fail but return NULL if we cannot find a mapping.
  *
- * Instead of knowing DEFAULTTABLESPACE_OID you can pass 0.
+ * InvalidOid can be passed instead of the current database's default
+ * tablespace.
  */
 Datum
 pg_filenode_relation(PG_FUNCTION_ARGS)
index 372cb33c003429a70f54a2fe95ce0ae6cb83c045..2a8f83775d26c6daa3f2a2ac2891ee2c4b81dafc 100644 (file)
@@ -210,7 +210,7 @@ RelidByRelfilenode(Oid reltablespace, Oid relfilenode)
 
        while (HeapTupleIsValid(ntp = systable_getnext(scandesc)))
        {
-               bool isnull;
+               bool isnull PG_USED_FOR_ASSERTS_ONLY;
 
                if (found)
                        elog(ERROR,