2 Chapter 9. Functions and Operators
7 9.2. Comparison Functions and Operators
8 9.3. Mathematical Functions and Operators
9 9.4. String Functions and Operators
13 9.5. Binary String Functions and Operators
14 9.6. Bit String Functions and Operators
18 9.7.2. SIMILAR TO Regular Expressions
19 9.7.3. POSIX Regular Expressions
21 9.8. Data Type Formatting Functions
22 9.9. Date/Time Functions and Operators
24 9.9.1. EXTRACT, date_part
27 9.9.4. AT TIME ZONE and AT LOCAL
28 9.9.5. Current Date/Time
29 9.9.6. Delaying Execution
31 9.10. Enum Support Functions
32 9.11. Geometric Functions and Operators
33 9.12. Network Address Functions and Operators
34 9.13. Text Search Functions and Operators
38 9.15.1. Producing XML Content
39 9.15.2. XML Predicates
40 9.15.3. Processing XML
41 9.15.4. Mapping Tables to XML
43 9.16. JSON Functions and Operators
45 9.16.1. Processing and Creating JSON Data
46 9.16.2. The SQL/JSON Path Language
47 9.16.3. SQL/JSON Query Functions
50 9.17. Sequence Manipulation Functions
51 9.18. Conditional Expressions
56 9.18.4. GREATEST and LEAST
58 9.19. Array Functions and Operators
59 9.20. Range/Multirange Functions and Operators
60 9.21. Aggregate Functions
61 9.22. Window Functions
62 9.23. Merge Support Functions
63 9.24. Subquery Expressions
70 9.24.6. Single-Row Comparison
72 9.25. Row and Array Comparisons
76 9.25.3. ANY/SOME (array)
78 9.25.5. Row Constructor Comparison
79 9.25.6. Composite Type Comparison
81 9.26. Set Returning Functions
82 9.27. System Information Functions and Operators
84 9.27.1. Session Information Functions
85 9.27.2. Access Privilege Inquiry Functions
86 9.27.3. Schema Visibility Inquiry Functions
87 9.27.4. System Catalog Information Functions
88 9.27.5. Object Information and Addressing Functions
89 9.27.6. Comment Information Functions
90 9.27.7. Data Validity Checking Functions
91 9.27.8. Transaction ID and Snapshot Information Functions
92 9.27.9. Committed Transaction Information Functions
93 9.27.10. Control Data Functions
94 9.27.11. Version Information Functions
95 9.27.12. WAL Summarization Information Functions
97 9.28. System Administration Functions
99 9.28.1. Configuration Settings Functions
100 9.28.2. Server Signaling Functions
101 9.28.3. Backup Control Functions
102 9.28.4. Recovery Control Functions
103 9.28.5. Snapshot Synchronization Functions
104 9.28.6. Replication Management Functions
105 9.28.7. Database Object Management Functions
106 9.28.8. Index Maintenance Functions
107 9.28.9. Generic File Access Functions
108 9.28.10. Advisory Lock Functions
110 9.29. Trigger Functions
111 9.30. Event Trigger Functions
113 9.30.1. Capturing Changes at Command End
114 9.30.2. Processing Objects Dropped by a DDL Command
115 9.30.3. Handling a Table Rewrite Event
117 9.31. Statistics Information Functions
119 9.31.1. Inspecting MCV Lists
121 PostgreSQL provides a large number of functions and operators for the
122 built-in data types. This chapter describes most of them, although
123 additional special-purpose functions appear in relevant sections of the
124 manual. Users can also define their own functions and operators, as
125 described in Part V. The psql commands \df and \do can be used to list
126 all available functions and operators, respectively.
128 The notation used throughout this chapter to describe the argument and
129 result data types of a function or operator is like this:
130 repeat ( text, integer ) → text
132 which says that the function repeat takes one text and one integer
133 argument and returns a result of type text. The right arrow is also
134 used to indicate the result of an example, thus:
135 repeat('Pg', 4) → PgPgPgPg
137 If you are concerned about portability then note that most of the
138 functions and operators described in this chapter, with the exception
139 of the most trivial arithmetic and comparison operators and some
140 explicitly marked functions, are not specified by the SQL standard.
141 Some of this extended functionality is present in other SQL database
142 management systems, and in many cases this functionality is compatible
143 and consistent between the various implementations.