]> begriffs open source - ai-pg/blob - full-docs/txt/functions.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / functions.txt
1
2 Chapter 9. Functions and Operators
3
4    Table of Contents
5
6    9.1. Logical Operators
7    9.2. Comparison Functions and Operators
8    9.3. Mathematical Functions and Operators
9    9.4. String Functions and Operators
10
11         9.4.1. format
12
13    9.5. Binary String Functions and Operators
14    9.6. Bit String Functions and Operators
15    9.7. Pattern Matching
16
17         9.7.1. LIKE
18         9.7.2. SIMILAR TO Regular Expressions
19         9.7.3. POSIX Regular Expressions
20
21    9.8. Data Type Formatting Functions
22    9.9. Date/Time Functions and Operators
23
24         9.9.1. EXTRACT, date_part
25         9.9.2. date_trunc
26         9.9.3. date_bin
27         9.9.4. AT TIME ZONE and AT LOCAL
28         9.9.5. Current Date/Time
29         9.9.6. Delaying Execution
30
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
35    9.14. UUID Functions
36    9.15. XML Functions
37
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
42
43    9.16. JSON Functions and Operators
44
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
48         9.16.4. JSON_TABLE
49
50    9.17. Sequence Manipulation Functions
51    9.18. Conditional Expressions
52
53         9.18.1. CASE
54         9.18.2. COALESCE
55         9.18.3. NULLIF
56         9.18.4. GREATEST and LEAST
57
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
64
65         9.24.1. EXISTS
66         9.24.2. IN
67         9.24.3. NOT IN
68         9.24.4. ANY/SOME
69         9.24.5. ALL
70         9.24.6. Single-Row Comparison
71
72    9.25. Row and Array Comparisons
73
74         9.25.1. IN
75         9.25.2. NOT IN
76         9.25.3. ANY/SOME (array)
77         9.25.4. ALL (array)
78         9.25.5. Row Constructor Comparison
79         9.25.6. Composite Type Comparison
80
81    9.26. Set Returning Functions
82    9.27. System Information Functions and Operators
83
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
96
97    9.28. System Administration Functions
98
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
109
110    9.29. Trigger Functions
111    9.30. Event Trigger Functions
112
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
116
117    9.31. Statistics Information Functions
118
119         9.31.1. Inspecting MCV Lists
120
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.
127
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
131
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
136
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.