PostgreSQL
Function Reference
Every function. Real examples. Pro tips. Emergency cheatsheets. Built for developers who need answers in under 5 seconds.
Try: · · ·
Interactive Tools
runs in your browserBrowse by Category
34 categoriesString
56 functions
Math / Numeric
48 functions
Date & Time
42 functions
JSON & JSONB
38 functions
Aggregate
24 functions
Window
18 functions
Conditional
8 functions
Type Conversion
22 functions
Regex
10 functions
Array
26 functions
Range
14 functions
Geometric
18 functions
Network Address
12 functions
Text Search
20 functions
XML
10 functions
Sequence
8 functions
System Info
30 functions
System Admin
22 functions
Trigger
6 functions
Statistics
28 functions
Cryptographic
14 functions
UUID
4 functions
Enum
6 functions
Binary String
14 functions
Bit String
10 functions
Set-Returning
16 functions
Subquery
8 functions
Comparison
12 functions
Logical
6 functions
Row & Array Cmp
8 functions
Composite Type
6 functions
pg_trgm
8 functions
fuzzystrmatch
6 functions
pg_stat
20 functions
Frequently Reached For
About This Reference
This PostgreSQL function reference covers every built-in function across 34 categories — from everyday string manipulation and date/time arithmetic to advanced window functions, JSONB querying, and full-text search. Each entry includes real SQL examples, version compatibility notes, anti-pattern warnings, and role-specific guidance for developers, DBAs, data engineers, and security engineers.
Whether you need PostgreSQL string functions like concat, regexp_replace, and split_part, or you're working with JSONB operators for semi-structured data — this reference is faster to search than the official PostgreSQL documentation.
Common questions answered here include: how to concatenate strings in a PostgreSQL query, how to use JSONB in PostgreSQL, how to do a case-insensitive search, and how to usedate_trunc for time-series bucketing.
For performance work, see the pg_stat functions and system admin functions — covering connection management, query cancellation, advisory locks, and how to optimize slow queries in PostgreSQL. The full-text search category covers tsvector, tsquery, ranking, and GIN indexes.
PostgreSQL is widely used with Python (via SQLAlchemy and psycopg2), Node.js (via pg and Prisma), and frameworks like Django, FastAPI, and Rails. It outperforms MySQL for complex queries, JSON storage, and extensibility — and beats MongoDB for structured data with occasional JSON fields.
Not sure which function to use? Start with the Emergency Cheatsheet — the 50 most-reached-for PostgreSQL commands on a single page — or the Gotchas & Traps page covering NULL surprises, timezone pitfalls, and integer division traps.