|
1 | 1 |
|
2 | 2 | Frequently Asked Questions (FAQ) for PostgreSQL
|
3 | 3 |
|
4 |
| - Last updated:Tue Dec 17 23:56:27 EST2002 |
| 4 | + Last updated:Sun Jan 12 00:16:01 EST2003 |
5 | 5 |
|
6 | 6 | Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
|
7 | 7 |
|
@@ -834,13 +834,14 @@ BYTEA bytea variable-length byte array (null-byte safe)
|
834 | 834 | space used is slightly greater than the declared size. However, these
|
835 | 835 | data types are also subject to compression or being stored out-of-line
|
836 | 836 | by TOAST, so the space on disk might also be less than expected.
|
837 |
| - |
838 |
| - CHAR(n) is best when storing strings that are usually the same length. |
839 | 837 | VARCHAR(n) is best when storing variable-length strings but it limits
|
840 | 838 | how long a string can be. TEXT is for strings of unlimited length,
|
841 |
| - maximum 1 gigabyte. BYTEA is for storing binary data, particularly |
842 |
| - values that include NULL bytes. These types have similar performance |
843 |
| - characteristics. |
| 839 | + maximum 1 gigabyte. |
| 840 | + |
| 841 | + CHAR(n) is for storing strings that are all the same length. CHAR(n) |
| 842 | + stores trailing spaces, while VARCHAR(n) trims them. BYTEA is for |
| 843 | + storing binary data, particularly values that include NULL bytes. |
| 844 | + These types have similar performance characteristics. |
844 | 845 |
|
845 | 846 | 4.15.1) How do I create a serial/auto-incrementing field?
|
846 | 847 |
|
|