Last active
May 3, 2021 21:41
-
-
Save garethflowers/26b64425ec77a0aa9fc3 to your computer and use it in GitHub Desktop.
Returns a sorted array.
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 array_sort( | |
| text[] | |
| ) | |
| RETURNS text[] | |
| LANGUAGE sql | |
| IMMUTABLE | |
| STRICT | |
| AS $$ | |
| SELECT ARRAY( | |
| SELECT x | |
| FROM unnest($1) AS x | |
| ORDER BY x | |
| ); | |
| $$; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment