36

to_tsvector() supports several languages: english, german, french ...

How to get full list of these languages ?

Oto Shavadze
  • 40,603
  • 55
  • 152
  • 236

1 Answers1

51

There are instructions in the manual how to retrieve all information with psql:

12.10. psql Support

Information about text search configuration objects can be obtained in psql using a set of commands:

\dF{d,p,t}[+] [PATTERN]

In particular:

List text search dictionaries (add + for more detail).

=> \dFd

There is more, read the manual.

Ultimately, possible parameter values for to_tsvector(), to_tsquery() et al. are defined by entries in the system catalog pg_ts_config, from where you can get the definitive list. As of Postgres 14:

test=> SELECT cfgname FROM pg_ts_config;
  cfgname   
------------
 simple
 arabic
 armenian
 basque
 catalan
 danish
 dutch
 english
 finnish
 french
 german
 greek
 hindi
 hungarian
 indonesian
 irish
 italian
 lithuanian
 nepali
 norwegian
 portuguese
 romanian
 russian
 serbian
 spanish
 swedish
 tamil
 turkish
 yiddish
(29 rows)

But more can be added.

Erwin Brandstetter
  • 605,456
  • 145
  • 1,078
  • 1,228
  • Thank you very much. `But more can be added` - you mean in future? or there is possible add another language manually right now? after searching I found nothing hopeful about this. – Oto Shavadze Sep 28 '16 at 16:42
  • 2
    @OTARIKI: Both: you can add more yourself (never done that myself, but the infrastructure is there), or Postgres might release more. – Erwin Brandstetter Sep 28 '16 at 16:47
  • 1
    @ErwinBrandstetter, can you help me to find docs to add a new language? – Ali Mamedov Jul 21 '20 at 09:14
  • 3
    @AliMamedov: Guess you want to create a new `TEXT SEARCH CONFIGURATION`. Start here: https://www.postgresql.org/docs/current/textsearch-configuration.html Related posts: https://stackoverflow.com/search?q=%5Bpostgres%5D+code%3A%22CREATE+TEXT+SEARCH+CONFIGURATION%22 – Erwin Brandstetter Jul 22 '20 at 00:08