I would like to join two tables based on if a column value in one table has an exact match in a large text column in the other. I guess you could do something like

.... JOIN .... ON t1.col ILIKE '%' || t2.col || '%'

Is this possible using full text search and tsvector? Using PostgreSQL 13.


I very much overcomplicated this. You can just do

.... JOIN .... ON to_tsvector(t1.col) @@ to_tsquery(t2.col)'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.