PostgreSQL – How to Configure PG Text Search Dictionary

google-cloud-sqlpostgresql

I want to add terms to a text search dictionary without access to the file system shares/tsearch_data (specifically for google cloud SQL).

Is there a syntax to do this via SQL?

All I have found is "ALTER TEXT SEARCH DICTIONARY.." which can configure how a dictionary works, but cannot be used to add or remove lines in the dictionary .rules/.syn/.dict file.

Best Answer

By design (it's hardcoded) tsearch_data directory is in SHAREDIR. If you want to change SHAREDIR you should use your own compiled version of PostgreSQL. If you are interested, you can read the documentations' Installation from Source Code section and If you still want to change tsearch_data, well PostgreSQL is opensource, you can change Makefile and ts_utils.c and again have your own version of PostgreSQL by compiling it.

You can also use symbolic link.