Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
146c83c0
Commit
146c83c0
authored
Apr 06, 2007
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some now-obsolete comments about the space used by various data
types.
parent
e1f1a535
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
19 deletions
+28
-19
doc/src/sgml/array.sgml
doc/src/sgml/array.sgml
+3
-3
doc/src/sgml/datatype.sgml
doc/src/sgml/datatype.sgml
+25
-16
No files found.
doc/src/sgml/array.sgml
View file @
146c83c0
<!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.
59 2007/03/02 06:01:01
tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.
60 2007/04/06 19:22:38
tgl Exp $ -->
<sect1 id="arrays">
<title>Arrays</title>
...
...
@@ -10,8 +10,8 @@
<para>
<productname>PostgreSQL</productname> allows columns of a table to be
defined as variable-length multidimensional arrays. Arrays of any
built-in or user-defined base type
can be created. (Arrays of
composite types or domains are not yet supported, however.)
built-in or user-defined base type
or enum type can be created.
(Arrays of
composite types or domains are not yet supported, however.)
</para>
<sect2>
...
...
doc/src/sgml/datatype.sgml
View file @
146c83c0
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.19
4 2007/04/05 01:46:27 momjian
Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.19
5 2007/04/06 19:22:38 tgl
Exp $ -->
<chapter id="datatype">
<title id="datatype-title">Data Types</title>
...
...
@@ -516,7 +516,7 @@ NUMERIC
type is more akin to <type>varchar(<replaceable>n</>)</type>
than to <type>char(<replaceable>n</>)</type>.) The actual storage
requirement is two bytes for each group of four decimal digits,
plus eight bytes overhead.
plus
five to
eight bytes overhead.
</para>
<indexterm>
...
...
@@ -842,9 +842,9 @@ ALTER SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceab
<tbody>
<row>
<entry>money</entry>
<entry>
4
bytes</entry>
<entry>
8
bytes</entry>
<entry>currency amount</entry>
<entry>-
21474836.48 to +21474836.4
7</entry>
<entry>-
92233720368547758.08 to +92233720368547758.0
7</entry>
</row>
</tbody>
</tgroup>
...
...
@@ -975,12 +975,13 @@ ALTER SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceab
</para>
<para>
The storage requirement for data of these types is 4 bytes plus the
actual string, and in case of <type>character</type> plus the
padding. Long strings are compressed by the system automatically, so
the physical requirement on disk might be less. Long values are also
stored in background tables so they do not interfere with rapid
access to the shorter column values. In any case, the longest
The storage requirement for a short string (up to 126 bytes) is 1 byte
plus the actual string, which includes the space padding in the case of
<type>character</type>. Longer strings have 4 bytes overhead instead
of 1. Long strings are compressed by the system automatically, so
the physical requirement on disk might be less. Very long values are also
stored in background tables so that they do not interfere with rapid
access to shorter column values. In any case, the longest
possible character string that can be stored is about 1 GB. (The
maximum value that will be allowed for <replaceable>n</> in the data
type declaration is less than that. It wouldn't be very useful to
...
...
@@ -994,8 +995,10 @@ ALTER SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceab
<tip>
<para>
There are no performance differences between these three types,
apart from the increased storage size when using the blank-padded
type. While <type>character(<replaceable>n</>)</type> has performance
apart from increased storage size when using the blank-padded
type, and a few extra cycles to check the length when storing into
a length-constrained column. While
<type>character(<replaceable>n</>)</type> has performance
advantages in some other database systems, it has no such advantages in
<productname>PostgreSQL</productname>. In most situations
<type>text</type> or <type>character varying</type> should be used
...
...
@@ -1080,7 +1083,7 @@ SELECT b, char_length(b) FROM test2;
<row>
<entry><type>"char"</type></entry>
<entry>1 byte</entry>
<entry>single-
character
internal type</entry>
<entry>single-
byte
internal type</entry>
</row>
<row>
<entry><type>name</type></entry>
...
...
@@ -1122,7 +1125,7 @@ SELECT b, char_length(b) FROM test2;
<tbody>
<row>
<entry><type>bytea</type></entry>
<entry>4 bytes plus the actual binary string</entry>
<entry>
1 or
4 bytes plus the actual binary string</entry>
<entry>variable-length binary string</entry>
</row>
</tbody>
...
...
@@ -2879,13 +2882,13 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
<row>
<entry><type>cidr</type></entry>
<entry>
12 or 24
bytes</entry>
<entry>
7 or 19
bytes</entry>
<entry>IPv4 and IPv6 networks</entry>
</row>
<row>
<entry><type>inet</type></entry>
<entry>
12 or 24
bytes</entry>
<entry>
7 or 19
bytes</entry>
<entry>IPv4 and IPv6 hosts and networks</entry>
</row>
...
...
@@ -3188,6 +3191,12 @@ SELECT * FROM test;
</programlisting>
</example>
<para>
A bit string value requires 1 byte for each group of 8 bits, plus
5 or 8 bytes overhead depending on the length of the string
(but long values may be compressed or moved out-of-line, as explained
in <xref linkend="datatype-character"> for character strings).
</para>
</sect1>
<sect1 id="datatype-xml">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment