The PostgreSQL formatting functions provide a powerful set of tools for converting various data types (date/time, integer, floating point, numeric) to formatted strings and for converting from formatted strings to specific data types. Table 9.26 lists them. These functions all follow a common calling convention: the first argument is the value to be formatted and the second argument is a template that defines the output or input format.
Table 9.26. Formatting Functions
|
Function Description Example(s) |
|---|
|
Converts time stamp to string according to the given format.
|
|
Converts interval to string according to the given format.
|
|
Converts number to string according to the given format; available for
|
|
Converts string to date according to the given format.
|
|
Converts string to numeric according to the given format.
|
|
Converts string to time stamp according to the given format. (See also
|
to_timestamp and