Skip to content
Advertisement

Error: Returned type unknown at ordinal position 2, but query expects text

I created an SQL function in PostgreSQL that returns a table with text values, it is throwing error

Function definition:

Advertisement

Answer

You could try casting the string literals explicitly to text using the double colon operator:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement