# Chapter 9. Functions and Operators
Table of Contents
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.2. SIMILAR TO
Regular Expressions
9.7.3. POSIX Regular Expressions
9.8. Data Type Formatting Functions
9.9. Date/Time Functions and Operators
9.11. Geometric Functions and Operators
9.12. Network Address Functions and Operators
9.13. Text Search Functions and Operators
9.16. JSON Functions and Operators
9.16.1. Processing and Creating JSON Data
9.16.2. The SQL/JSON Path Language
9.17. Sequence Manipulation Functions
9.19. Array Functions and Operators
9.20. Range/Multirange Functions and Operators
9.24. Row and Array Comparisons
9.24.5. Row Constructor Comparison
9.24.6. Composite Type Comparison
9.26. System Information Functions and Operators
9.27. System Administration Functions
9.27.1. Configuration Settings Functions
9.27.2. Server Signaling Functions
9.27.3. Backup Control Functions
9.27.4. Recovery Control Functions
9.27.5. Snapshot Synchronization Functions
9.27.6. Replication Management Functions
9.27.7. Database Object Management Functions
9.27.8. Index Maintenance Functions
9.27.9. Generic File Access Functions
9.27.10. Advisory Lock Functions
9.29.1. Capturing Changes at Command End
9.29.2. Processing Objects Dropped by a DDL Command
9.29.3. Handling a Table Rewrite Event
9.30. 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.