I have to create a function in PostgreSQL to show the pair characters of a string passed as a parameter.
What I thought was to loop through the chars of the string, like I would do it in C or Java or whatever, but I don't know how to access to a character individually, what would be str[i], for example, being str a string, and i the position of the char.
What I mean by "pair characters" is characters in pair positions: that is, characters in the string whose position modulo 2 = 0. If the input parameter is "String", the characters showed by the function would be "t" (ie position 2, starting from position 1), and "i" (ie position 4), "g"(position 6).
SUBSTRINGfunction.