non-reserved keywords which have
- a proscribed meaning in the language but which are also allowed
+ a prescribed meaning in the language but which are also allowed
as identifiers.
Postgres has additional keywords
which allow similar unrestricted usage.
/* multi
line
- comment */
+ comment
+ */
Names in SQL are sequences of less than NAMEDATALEN alphanumeric characters,
starting with an alphabetic character. By default, NAMEDATALEN is set
to 32, but at the time the system is built, NAMEDATALEN can be changed
- by changing the #ifdef in src/backend/include/postgres.h. Underscore
- ("_") is considered an alphabetic character.
+ by changing the #define in
+ src/backend/include/postgres.h.
+ Underscore ("_") is considered an alphabetic character.
+
+
+ In some contexts, names may contain other characters if surrounded
+ by double quotes. For example, table or column names may contain otherwise
+ disallowed characters such as spaces, ampersands, etc. using this
+ technique.
Strings
in SQL are arbitrary sequences of ASCII characters bounded by single
- quotes ("'", e.g. 'This is a string').
+ quotes ("'", e.g. 'This is a string').
Uppercase alphabetics within strings are accepted
literally. Non-printing characters may be embedded within strings by
prepending them with a backslash
values range from -2147483648 to +2147483647. This will vary
depending on the operating system and host machine.
+
+ Note that larger integers can be specified for int8
+ by using
SQL92 string notation or
+
Postgres type notation:
+
+int8 '4000000000' -- string style
+'4000000000'::int8 -- Postgres (historical) style
+
+
You must include at least one dig after the
period and after the [+-] if you use those options. An exponent with
a missing mantissa has a mantissa of 1 inserted. There may be no
- extra characters embedded in the string.
- Floating point constaints are of type float8.
+ extra characters embedded in the string.
+
+
+ Floating point constaints are of type
+ float8. float4 can be specified
+ explicitly by using
SQL92 string notation or
+
Postgres type notation:
+
+float4 '1.23' -- string style
+'1.23'::float4 -- Postgres (historical) style
+
The value inside the string is passed to the input
- conversion routine for the type called type-name. The result is a
+ conversion routine for the type called
+ type. The result is a
constant of the indicated type. The explicit typecast may be omitted
if there is no ambiguity as to the type the constant must be, in which
case it is automatically coerced.