1

I have a MySQL database with a FULLTEXT index that I wish to port to Postgres. When I create a Postgres database using pgloader, the index in Postgres becomes this:

"idx_33441_ibtsearchidx" gin (to_tsvector('simple'::regconfig, keywords))

Now, the simple configuration is not what I want; I, for this application, need english. I can manually enter an ALTER INDEX statement in psql after the migration, but I would like to fully automate the pgloader process (which worked beautifully in every other case!)

But how do I configure pgloader to do this? I seems like there are three possibilities:

  1. Just put an ALTER INDEX statement into the pgloader script's AFTER LOAD section. But the problem is, I won't know the index name. Also I think this approach would be inefficient since an index was made and then a new one would be made after that.

  2. Tell pgloader NOT to automatically make the fulltext index in Postgres. I don't know how to do this. Can it be done? I know how to exclude tables but not indexes. Here I can do the ALTER INDEX in the AFTER LOAD section no problem, because I can choose my own index name.

  3. Specify exactly the full text index configuration I want in the pgloader script. I was unable to find an option for doing this in the pgloader reference. Is it possible?

Ray Toal
  • 86,166
  • 18
  • 182
  • 232

0 Answers0