Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Fix failure to follow the directions when "init" fork was added.
authorFujii Masao <fujii@postgresql.org>
Mon, 11 Aug 2014 14:19:23 +0000 (23:19 +0900)
committerFujii Masao <fujii@postgresql.org>
Mon, 11 Aug 2014 14:20:21 +0000 (23:20 +0900)
Specifically this commit updates forkname_to_number() so that the HINT
message includes "init" fork, and also adds the description of "init" fork
into pg_relation_size() document.

This is a part of the commit 2d00190495b22e0d0ba351b2cda9c95fb2e3d083
which has fixed the same oversight in master and 9.4. Back-patch to
9.1 where "init" fork was added.

doc/src/sgml/func.sgml
src/backend/catalog/catalog.c

index f1ae736ef3f7ca004c658c8fc5a0977ea14440c5..82238f700801cf3feaee2eab043cc9e5132d0aba 100644 (file)
@@ -14400,7 +14400,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
        <entry><type>bigint</type></entry>
        <entry>
         Disk space used by the specified fork (<literal>'main'</literal>,
-        <literal>'fsm'</literal> or <literal>'vm'</>)
+        <literal>'fsm'</literal>, <literal>'vm'</>, or <literal>'init'</>)
         of the specified table or index
        </entry>
       </row>
@@ -14521,6 +14521,12 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
        (see <xref linkend="storage-vm">) associated with the relation.
       </para>
      </listitem>
+     <listitem>
+      <para>
+       <literal>'init'</literal> returns the size of the initialization fork,
+       if any, (see <xref linkend="storage-init">) associated with the relation.
+      </para>
+     </listitem>
     </itemizedlist>
    </para>
 
index 03799b5ba6a834c40df77b092a9529f136d53f75..79c1a1d01d15a2a6b9c66864879c5f33f010989d 100644 (file)
@@ -74,7 +74,8 @@ forkname_to_number(char *forkName)
    ereport(ERROR,
            (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
             errmsg("invalid fork name"),
-            errhint("Valid fork names are \"main\", \"fsm\", and \"vm\".")));
+            errhint("Valid fork names are \"main\", \"fsm\", "
+                    "\"vm\", and \"init\".")));
    return InvalidForkNumber;   /* keep compiler quiet */
 }