In PostgreSQL, we can use the the substr()
function to return a substring from a string, based on a starting point. We have the option of specifying how many characters to return.
We pass the string as the first argument and the start position as the second. If we want to specify how long the substring should be, we can pass a third argument that specifies how many characters to return.
The function returns the same result as the substring()
function (which uses a slightly different syntax).