summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2014-08-11 23:19:23 +0900
committerFujii Masao <fujii@postgresql.org>2014-08-11 23:20:05 +0900
commit054fc30965f3d3361e80fa57887f58e1a178cfe8 (patch)
tree4f40e39c9547f1799dccd263f6e89473dfff825b
parent84317b072021250c78cd1e127913f5d0a30e9028 (diff)
Fix failure to follow the directions when "init" fork was added.
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.
-rw-r--r--doc/src/sgml/func.sgml8
-rw-r--r--src/backend/catalog/catalog.c3
2 files changed, 9 insertions, 2 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 76bd58d306d..2a39c244ee6 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -14991,7 +14991,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>
@@ -15125,6 +15125,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>
diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c
index bd56534be5b..03671104d09 100644
--- a/src/backend/catalog/catalog.c
+++ b/src/backend/catalog/catalog.c
@@ -75,7 +75,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 */
}