RPAD returns a VARCHAR value representing a string of a specific length filled on the right with specific characters.
Syntax
RPAD ( expression , length [ , fill ] )
Semantics
expression |
(CHAR OR VARCHAR) specifies the string to fill |
length |
(INTEGER) specifies the number of characters to return |
fill |
(CHAR OR VARCHAR) specifes the repeating string of characters with which to fill the output string. The default is the space character. |
Notes
Examples
> SELECT RPAD('database', 15, 'xzy');
rpad
-----------------
databasexzyxzyx
(1 row)