如何指定 postgres FTS .syn 文件的完整路径?

How to specify full path for postgres FTS .syn file?

documentation 的示例中:

CREATE TEXT SEARCH DICTIONARY syn (template=synonym, synonyms='synonym_sample');

我希望能够为 .syn 文件指定完整路径,而不是默认的 $SHAREDIR/synonym_sample

根据您引用的PostgreSQL documentation

The only parameter required by the synonym template is SYNONYMS, which is the base name of its configuration file — my_synonyms in the above example. The file's full name will be $SHAREDIR/tsearch_data/my_synonyms.syn (where $SHAREDIR means the PostgreSQL installation's shared-data directory).

(强调我的)

您应该将词典放在该特定目录中。我想这只是为了文件权限处理(用户 运行 PostgreSQL 进程必须有权访问此目录)和标准化。您可以选择名称,但不能选择文件的位置。