PostgreSQL RTRIM() function
RTRIM() function
The PostgreSQL rtrim 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 end of a string.
Syntax:
rtrim(<string> [, < trimming_text >])
PostgreSQL Version: 9.3
Pictorial Presentation of PostgreSQL RTRIM() function

Example: PostgreSQL RTRIM() function:
In the example below, the matching text is 'best' mention in the second parameter in which 'e','s' and 't' is matching from the end of the first parameter and removed from the string.
Code:
SELECT rtrim('rtrimtest', 'best');
Sample Output:
rtrim ------- rtrim (1 row)
Example 2:
In the example below, no matching text is specified so the default white spaces have been removed from the end of the string.
Code:
SELECT rtrim('rtrim ');
Sample Output:
rtrim ------- rtrim (1 row)
Previous: RPAD function
Next: SPLIT_PART function
- Weekly Trends
- 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
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises