Simplify the syntax of CREATE/ALTER TEXT SEARCH DICTIONARY by treating the
Tom Lane <tgl@sss.pgh.pa.us>
Simplify the syntax of CREATE/ALTER TEXT SEARCH DICTIONARY by treating the init options of the template as top-level options in the syntax. This also makes ALTER a bit easier to use, since options can be replaced individually. I also made these statements verify that the tmplinit method will accept the new settings before they get stored; in the original coding you didn't find out about mistakes until the dictionary got invoked. Under the hood, init methods now get options as a List of DefElem instead of a raw text string --- that lets tsearch use existing options-pushing code instead of duplicating functionality.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/alter_tsdictionary.sgml | modified | +36 −10 |
| doc/src/sgml/ref/create_tsdictionary.sgml | modified | +36 −7 |
| src/backend/commands/tsearchcmds.c | modified | +393 −58 |
| src/backend/snowball/dict_snowball.c | modified | +12 −26 |
| src/backend/snowball/snowball.sql.in | modified | +2 −2 |
| src/backend/tsearch/dict_ispell.c | modified | +14 −27 |
| src/backend/tsearch/dict_simple.c | modified | +24 −7 |
| src/backend/tsearch/dict_thesaurus.c | modified | +12 −25 |
| src/backend/tsearch/ts_utils.c | modified | +1 −164 |
| src/backend/tsearch/wparser.c | modified | +9 −2 |
| src/backend/tsearch/wparser_def.c | modified | +43 −53 |
| src/backend/utils/cache/ts_cache.c | modified | +20 −11 |
| src/bin/pg_dump/pg_dump.c | modified | +3 −5 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_proc.h | modified | +6 −6 |
| src/include/commands/defrem.h | modified | +4 −1 |
| src/include/tsearch/ts_public.h | modified | +1 −11 |