0

I am using unaccent extension in my PostgreSQL database.

I install it by

CREATE EXTENSION IF NOT EXISTS unaccent

and then within a connection it runs fine. But when I reconnect to the database i run unaccent function and it throws error function unaccent(character varying) does not exist and I need to run CREATE EXTENSION ... again. Then it works fine.

My problem is that I need to run the unaccent extension everytime I connect to the database without the need to re-create it.

What should I do to enable unaccent for every connection.

2
  • It sounds like maybe you aren't committing after creating the extension? You should only have to install it once. Commented Nov 13, 2019 at 13:37
  • @Jeremy thanks a lot, that did the trick :) ... I am new to PostgreSQL. Feel free to put it as answer. I will mark it. Commented Nov 13, 2019 at 13:39

1 Answer 1

3

The CREATE EXTENSION command should only need to be run once. If you ran it in a transaction, the transaction will need to be committed to ensure that future connections can use it.

Sign up to request clarification or add additional context in comments.

1 Comment

It's kinda strange that transactions are not mentioned in the official documentarion about CREATE EXTENSION command, eh. Probably should be added?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.