Scalar Data Types Syntax
The scalar data types are simple data types that hold a single value.For reasons of organisation, the syntax of BLOB types are defined separately in [fblangref50-datatypes-syntax-blob].
<domain_or_non_array_type> ::=
<scalar_datatype>
| <blob_datatype>
| [TYPE OF] domain
| TYPE OF COLUMN rel.col
<scalar_datatype> ::=
SMALLINT | INT[EGER] | BIGINT | INT128
| REAL | FLOAT [(bin_prec)] | DOUBLE PRECISION
| DECFLOAT [(dec_prec)]
| BOOLEAN
| DATE
| TIME [{WITHOUT | WITH} TIME ZONE]
| TIMESTAMP [{WITHOUT | WITH} TIME ZONE]
| {DECIMAL | DEC | NUMERIC} [(precision [, scale])]
| {VARCHAR | {CHAR | CHARACTER} VARYING} (length)
[CHARACTER SET charset]
| {CHAR | CHARACTER} [(length)] [CHARACTER SET charset]
| {NCHAR | NATIONAL {CHARACTER | CHAR}} VARYING (length)
| {NCHAR | NATIONAL {CHARACTER | CHAR}} [(length)]
| BINARY [(length)]
| {VARBINARY | BINARY VARYING} (length)
| Argument | Description |
|---|---|
domain |
Domain (only non-array domains) |
rel |
Name of a table or view |
col |
Name of a column in a table or view (only columns of a non-array type) |
bin_prec |
Binary precision, default is 24. 1 - 24: 32-bit single precision |
dec_prec |
Decimal precision of |
precision |
Numeric precision in decimal digits.From 1 to 38 |
scale |
Scale, or number of decimals.From 0 to 38.It must be less than or equal to precision |
length |
The maximum length of a string, in characters, or — for |
charset |
Character set |
domain_or_non_array_type |
Non-array types that can be used in PSQL code and casts |