09
Chapter 9
String Functions
Text in Postgres. Concatenation, casing, trimming, regex, and the functions that quietly do most of the work.
In this chapter
19
queries, easy → advanced
- 001UPPER, LOWER, INITCAP: case functionsRead
- 002LENGTH and CHAR_LENGTHRead
- 003TRIM, LTRIM, RTRIM: remove whitespaceRead
- 004CONCAT and || operator for string buildingRead
- 005SPLIT_PART: extract part of delimited stringRead
- 006REPLACE and REGEXP_REPLACERead
- 007FORMAT: printf-style string formattingRead
- 008REGEXP_MATCHES: extract all regex matchesRead
- 009LEVENSHTEIN: fuzzy matching distanceRead
- 010TO_TSVECTOR + TO_TSQUERY: full-text searchRead
- 011Array aggregation and unnesting patternsRead
- 012Concatenate first and last name with CONCAT_WSRead
- 013Extract domain from email addressesRead
- 014Pad strings to fixed width for reportsRead
- 015Extract numbers from alphanumeric stringsRead
- 016Generate slugs from product namesRead
- 017Parse structured strings into columnsRead
- 018JSON-like string parsing with SUBSTRING and POSITIONRead
- 019Soundex and metaphone for phonetic matchingRead