Chapter 9. Functions and Operators
Table of Contents
- 9.1. Logical Operators
- 9.2. Comparison Functions and Operators
- 9.3. Mathematical Functions and Operators
- 9.4. String Functions and Operators
- 9.5. Binary String Functions and Operators
- 9.6. Bit String Functions and Operators
- 9.7. Pattern Matching
- 9.8. Data Type Formatting Functions
- 9.9. Date/Time Functions and Operators
- 9.10. Enum Support Functions
- 9.11. Geometric Functions and Operators
- 9.12. Network Address Functions and Operators
- 9.13. Text Search Functions and Operators
- 9.14. UUID Functions
- 9.15. XML Functions
- 9.16. JSON Functions and Operators
- 9.17. Sequence Manipulation Functions
- 9.18. Conditional Expressions
- 9.19. Array Functions and Operators
- 9.20. Range/Multirange Functions and Operators
- 9.21. Aggregate Functions
- 9.22. Window Functions
- 9.23. Merge Support Functions
- 9.24. Subquery Expressions
- 9.25. Row and Array Comparisons
- 9.26. Set Returning Functions
- 9.27. System Information Functions and Operators
-
- 9.27.1. Session Information Functions
- 9.27.2. Access Privilege Inquiry Functions
- 9.27.3. Schema Visibility Inquiry Functions
- 9.27.4. System Catalog Information Functions
- 9.27.5. Object Information and Addressing Functions
- 9.27.6. Comment Information Functions
- 9.27.7. Data Validity Checking Functions
- 9.27.8. Transaction ID and Snapshot Information Functions
- 9.27.9. Committed Transaction Information Functions
- 9.27.10. Control Data Functions
- 9.27.11. Version Information Functions
- 9.27.12. WAL Summarization Information Functions
- 9.28. System Administration Functions
-
- 9.28.1. Configuration Settings Functions
- 9.28.2. Server Signaling Functions
- 9.28.3. Backup Control Functions
- 9.28.4. Recovery Control Functions
- 9.28.5. Snapshot Synchronization Functions
- 9.28.6. Replication Management Functions
- 9.28.7. Database Object Management Functions
- 9.28.8. Index Maintenance Functions
- 9.28.9. Generic File Access Functions
- 9.28.10. Advisory Lock Functions
- 9.29. Trigger Functions
- 9.30. Event Trigger Functions
- 9.31. Statistics Information Functions
PostgreSQL
provides a large number of
functions and operators for the built-in data types. This chapter
describes most of them, although additional special-purpose functions
appear in relevant sections of the manual. Users can also
define their own functions and operators, as described in
Part V
. The
psql
commands
\df
and
\do
can be used to list all
available functions and operators, respectively.
The notation used throughout this chapter to describe the argument and result data types of a function or operator is like this:
repeat
(text
,integer
) →text
which says that the function
repeat
takes one text and
one integer argument and returns a result of type text. The right arrow
is also used to indicate the result of an example, thus:
repeat('Pg', 4) → PgPgPgPg
If you are concerned about portability then note that most of the functions and operators described in this chapter, with the exception of the most trivial arithmetic and comparison operators and some explicitly marked functions, are not specified by the SQL standard. Some of this extended functionality is present in other SQL database management systems, and in many cases this functionality is compatible and consistent between the various implementations.