Created
January 28, 2020 14:19
-
-
Save biswanaths/889366e58e5be38a391ac9eba9b29211 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION appendbar(s1 varchar) RETURNS varchar IMMUTABLE AS $$ | |
def appendbar(value): | |
value = value or "" | |
return value + "_bar" | |
return appendbar(s1) | |
$$ language plpythonu; | |
-- usage example | |
select name, appendbar(name) from table_foo limit 20; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment