Skip to content

Instantly share code, notes, and snippets.

@fabriziomello
Last active February 24, 2016 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabriziomello/6006ac33c955e9a7cac0 to your computer and use it in GitHub Desktop.
Save fabriziomello/6006ac33c955e9a7cac0 to your computer and use it in GitHub Desktop.
Hacking PostgreSQL: exemplo array_remove(anyarray, anyarray) em PL/SQL
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