Created
July 10, 2014 01:43
-
-
Save subssn21/e9e121f6fd5ff50f688d to your computer and use it in GitHub Desktop.
backport array_remove to postgres 9.2
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_remove(a anyarray, e anyelement) returns anyarray as $$ | |
| BEGIN | |
| return array( | |
| select x from unnest(a) x where x <> e | |
| ); | |
| END; | |
| $$ LANGUAGE plpgsql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note to self
this works fine, if you want to avoid the new function