198
198
<entry>signed two-byte integer</entry>
199
199
</row>
200
200
201
+ <row>
202
+ <entry><type>smallserial</type></entry>
203
+ <entry><type>serial2</type></entry>
204
+ <entry>autoincrementing two-byte integer</entry>
205
+ </row>
206
+
201
207
<row>
202
208
<entry><type>serial</type></entry>
203
209
<entry><type>serial4</type></entry>
368
374
<entry>15 decimal digits precision</entry>
369
375
</row>
370
376
377
+ <row>
378
+ <entry><type>smallserial</type></entry>
379
+ <entry>2 bytes</entry>
380
+ <entry>small autoincrementing integer</entry>
381
+ <entry>1 to 32767</entry>
382
+ </row>
383
+
371
384
<row>
372
385
<entry><type>serial</></entry>
373
386
<entry>4 bytes</entry>
@@ -742,6 +755,10 @@ NUMERIC
742
755
<sect2 id="datatype-serial">
743
756
<title>Serial Types</title>
744
757
758
+ <indexterm zone="datatype-serial">
759
+ <primary>smallserial</primary>
760
+ </indexterm>
761
+
745
762
<indexterm zone="datatype-serial">
746
763
<primary>serial</primary>
747
764
</indexterm>
@@ -750,6 +767,10 @@ NUMERIC
750
767
<primary>bigserial</primary>
751
768
</indexterm>
752
769
770
+ <indexterm zone="datatype-serial">
771
+ <primary>serial2</primary>
772
+ </indexterm>
773
+
753
774
<indexterm zone="datatype-serial">
754
775
<primary>serial4</primary>
755
776
</indexterm>
@@ -769,8 +790,8 @@ NUMERIC
769
790
</indexterm>
770
791
771
792
<para>
772
- The data types <type>serial </type> and <type>bigserial </type>
773
- are not true types, but merely
793
+ The data types <type>smallserial </type>, <type>serial </type> and
794
+ <type>bigserial</type> are not true types, but merely
774
795
a notational convenience for creating unique identifier columns
775
796
(similar to the <literal>AUTO_INCREMENT</literal> property
776
797
supported by some other databases). In the current
@@ -828,7 +849,9 @@ ALTER SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceab
828
849
the same way, except that they create a <type>bigint</type>
829
850
column. <type>bigserial</type> should be used if you anticipate
830
851
the use of more than 2<superscript>31</> identifiers over the
831
- lifetime of the table.
852
+ lifetime of the table. The type names <type>smallserial</type> and
853
+ <type>serial2</type> also work the same way, execpt that they
854
+ create a <type>smallint</type> column.
832
855
</para>
833
856
834
857
<para>
0 commit comments