PG
PRO
PostgreSQL 17 · 400+ functions

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 browser

Browse by Category

34 categories

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.