11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.140 2004/01/20 22:46:06 tgl Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.141 2004/02/01 06:27:48 tgl Exp $
33-->
44
55 <chapter id="datatype">
@@ -901,6 +901,18 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (
901901 management systems have it as well.
902902 </para>
903903
904+ <para>
905+ Values of type <type>character</type> are physically padded
906+ with spaces to the specified width <replaceable>n</>, and are
907+ stored and displayed that way. However, the padding spaces are
908+ treated as semantically insignificant. Trailing spaces are
909+ disregarded when comparing two values of type <type>character</type>,
910+ and they will be removed when converting a <type>character</type> value
911+ to one of the other string types. Note that trailing spaces
912+ <emphasis>are</> semantically significant in
913+ <type>character varying</type> and <type>text</type> values.
914+ </para>
915+
904916 <para>
905917 The storage requirement for data of these types is 4 bytes plus the
906918 actual string, and in case of <type>character</type> plus the
@@ -922,7 +934,11 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (
922934 <para>
923935 There are no performance differences between these three types,
924936 apart from the increased storage size when using the blank-padded
925- type.
937+ type. While <type>character(<replaceable>n</>)</type> has performance
938+ advantages in some other database systems, it has no such advantages in
939+ <productname>PostgreSQL</productname>. In most situations
940+ <type>text</type> or <type>character varying</type> should be used
941+ instead.
926942 </para>
927943 </tip>
928944
0 commit comments