Hi,
You can create your own "decode" function in pg like this example using varchars as input. Then simply create other overloaded "decode" functions for different input datatypes.
CREATE OR REPLACE FUNCTION decode(expr varchar, search varchar, result varchar, dflt varchar) RETURNS varchar AS
$$
BEGIN
CASE WHEN expr = search THEN RETURN result; ELSE RETURN dflt; END CASE;
END
$$ LANGUAGE plpgsql;
Regards,
Michael Vitale
JORGE MALDONADO wrote on 4/6/2021 12:34 AM:Hi,
In my DB, one of my tables has a field that is URL Encoded (its value is a URL of course).
For example, the value:
is URL Encoded like this:
Is there a PostgreSQL function to URL Decode such field when performing a SELECT statement? I have not found anything in documentation.
Best regards,
Jorge Maldonado