In this PostgreSQL post explains how to use the PostgreSQL rtrim function with syntax and examples.
The PostgreSQL rtrim function removes all specified characters from the right-hand side of a string.
The syntax for the rtrim function in PostgreSQL is:
The string to trim from the right-hand side.
The set of characters that will be removed from the right-hand side of string. If this parameter is omitted, the rtrim function will remove space characters from the right-hand side of string.
The rtrim function can be used in the following versions of PostgreSQL:
Let's look at some PostgreSQL rtrim function examples and explore how to use the rtrim function in PostgreSQL.
For example:
(Please note that for each of the example results below, we have included single quotes around the result to demonstrate what the rtrim function returns in PostgreSQL. If you ran these commands yourself, you would not see the single quotes in the result):