Last active
March 8, 2018 20:02
-
-
Save glassresistor/2c1e5c4a999eb9d48b555f129eb2aad2 to your computer and use it in GitHub Desktop.
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 remove_words(message text) RETURNS SETOF text AS $$ | |
BEGIN | |
RETURN QUERY select * from regexp_split_to_table(message, E'\\s+') except select boring_words.word from boring_words where boring_words.word = ANY(regexp_split_to_array(message, E'\\s+')); | |
END; | |
$$ LANGUAGE plpgsql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ERROR: relation "allowed_words" does not exist
LINE 1: ...t_to_table(message, E'\s+') except select * from allowed_wo...
^
QUERY: select * from regexp_split_to_table(message, E'\s+') except select * from allowed_words
CONTEXT: PL/pgSQL function remove_words(text) line 6 at RETURN QUERY