Last active
February 24, 2016 22:18
-
-
Save fabriziomello/6006ac33c955e9a7cac0 to your computer and use it in GitHub Desktop.
Hacking PostgreSQL: exemplo array_remove(anyarray, anyarray) em PL/SQL
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 OR REPLACE FUNCTION array_remove (anyarray, anyarray) RETURNS anyarray | |
AS $$ | |
SELECT array( | |
SELECT e | |
FROM unnest($1) AS s(e) | |
WHERE NOT e = ANY($2) | |
); | |
$$ | |
LANGUAGE sql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment