Constants v16
The kinds of implicitly typed constants in EDB Postgres Advanced Server are strings and numbers. You can also specify constants with explicit types, which can enable more accurate representation and more efficient handling by the system.
String constants
A string constant in SQL is an arbitrary sequence of characters bounded by single quotes (')
, for example 'This is a string'
. To include a single-quote character in a string constant, include two adjacent single quotes, for example, 'Dianne''s horse'
. (The two single quotes diffe from a double-quote character (")
.)
Numeric constants
Numeric constants are accepted in these general forms:
Where digits
is one or more decimal digits (0 through 9). You must enter at least one digit before or after the decimal point, if one is used. At least one digit must follow the exponent marker (e)
, if one is present. Don't embed any spaces or other characters in the constant. Leading plus or minus signs aren't considered part of the constant. They are operators applied to the constant.
These are some examples of valid numeric constants: