Created
January 31, 2014 19:07
-
-
Save jjl/8740872 to your computer and use it in GitHub Desktop.
The missing useful postgresql json function
This file contains hidden or 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 OR REPLACE FUNCTION json_array_elements_text(arr json) RETURNS SETOF text AS $$ | |
| BEGIN | |
| RETURN QUERY SELECT arr->>i | |
| FROM generate_series(0,json_array_length(arr)-1) i; | |
| END | |
| $$ LANGUAGE plpgsql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment