PostgreSQL LTRIM() function
LTRIM() function
The PostgreSQL ltrim() function is used to remove spaces ( if no character(s) is provided as trimming_text ) or set of characters which are matching with the trimming_text, from the start of a string.
Syntax:
ltrim(<string>[, <triming_text>])
PostgreSQL Version: 9.3
Pictorial Presentation of PostgreSQL LTRIM() function

Example: PostgreSQL ltrim() function:
In the example below, the statement returns the result 'ltrim'. Here in the example the trimming_text is provided, and it is 'best', and the left four characters i.e. 'test' have removed and the characters 't' and 'e' and 's' are present in the trimming_text 'best'.
Code:
SELECT ltrim('testltrim', 'best');
Sample Output:
ltrim ------- ltrim (1 row)
Example of PostgreSQL ltrim() function with no text:
In the example below, the trimming_text is not provided, so by default the white spaces from the left side of the given string will be removed.
Code:
SELECT ltrim(' ltrim');
Sample Output:
ltrim ------- ltrim (1 row)
Previous: LPAD function
Next: PG_CLIENT_ENCODING function
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook