I want to search for the letters in the "spelling" (text[]
) column:
a n n o y t
I need it to find the words: any, annoy, no, an, toy But not find: derivatives of annoy (annoying, annoyance), only find no once.
I also need the query to NOT find annoy if even a single letter is missing (such as anoyt).
I am using PostgreSQL 13.5
ronshome=# SELECT reference, word, spelling FROM word_mash_dictionary
WHERE word LIKE 'annoy';
reference | word | spelling
-----------+-------+-------------
420 | annoy | {a,n,n,o,y}
(1 row)
This is the table structure:
Table "public.word_mash_dictionary"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
-------------+--------+-----------+----------+---------------------------------------------------------+----------+--------------+-------------
reference | bigint | | not null | nextval('word_mash_dictionary_reference_seq'::regclass) | plain | |
word | text | | | | extended | |
spelling | text[] | | | | extended | |
ignore | bigint | | | | plain | |
list_100 | bigint | | | | plain | |
list_300 | bigint | | | | plain | |
list_500 | bigint | | | | plain | |
list_800 | bigint | | | | plain | |
list_1000 | bigint | | | | plain | |
list_2000 | bigint | | | | plain | |
list_3000 | bigint | | | | plain | |
list_5000 | bigint | | | | plain | |
list_7000 | bigint | | | | plain | |
list_10000 | bigint | | | | plain | |
word_length | bigint | | | | plain | |
list_*
columns (or strip them away).