- The numeric types have a full set of corresponding arithmetic operators and
- functions. Refer to for more information.
+ The syntax of constants for the numeric types is described in
+ . The numeric types have a
+ full set of corresponding arithmetic operators and
+ functions. Refer to for more
+ information.
CREATE SEQUENCE tablename_colname_seq;
CREATE TABLE tablename
- (colname INT4 DEFAULT nextval('tablename_colname_seq');
+ (colname integer DEFAULT nextval('tablename_colname_seq');
CREATE UNIQUE INDEX tablename_colname_key on tablename (colname);
Monetary Type
-
Obsolete Type
+
Deprecated
- The money is now deprecated. Use numeric
- or decimal instead. The money type may become a
- locale-aware layer over the numeric type in a future release.
+ The money is now deprecated. Use
+ numeric or decimal instead, in
+ combination with the to_char function. The
+ money type may become a locale-aware layer over the
+ numeric type in a future release.
- The money type supports US-style currency with
- fixed decimal point representation.
- If
Postgres is compiled with USE_LOCALE
- then the money type should use the monetary conventions defined for
- locale(7).
+ The money type stores U.S.-style currency with fixed
+ decimal point representation. If
+
Postgres is compiled with locale
+ support then the money type uses locale-specific
+ output formatting.
+
+
+ Input is accepted in a variety of formats, including integer and
+ floating point literals, as well as typical
+ currency formatting, such as '$1,000.00'.
+ Output is in the latter form.
-
- numeric
- will replace the money type, and should be preferred.
-
-
+
Character Types
limit on the size of the field.
+ Refer to for information about
+ the syntax of string literals, and to
+ for information about available operators and functions.
+
+
- Remember that any date or time input needs to be enclosed into single quotes,
- like text strings.
+ Remember that any date or time input needs to be enclosed into
+ single quotes, like text strings. Refer to
+ linkend="sql-syntax-constants-generic"> for more information.
+ SQL requires the following syntax
+
+type 'value'
+
+ but
Postgres is more flexible.
|
State
- Output
Input
+ Output
|
True
- 't'
TRUE, 't', 'true', 'y', 'yes', '1'
+ t
|
False
- 'f'
FALSE, 'f', 'false', 'n', 'no', '0'
+ f
-
+ id="sql-syntax-constants-generic">
Constants of Other Types