In PostgreSQL, the Overlay function allows users to replace a substring, which is starting at a specific position and having a specified length.

Here is the syntax for the Overlay Function:

BY Best Interview Question ON 19 Jun 2020

Example

overlay(<main_string> placing <replaced_string> <br>
from <starting_position> [ for <number_of_characters>] )