0

Why use ::tsvector when you have to_tsvector in Postgres?

1 Answer 1

1

Just for convenience. In Postgres, you can define your own unary or binary operator or casting rule, and when you define it, you must provide a corresponding 1- or 2-argument function.

At the same time, to_tsvector(..) function is overloaded -- it can be 1-argument, or 2-argument function, and in the latter case it is possible to explicitly specify FTS configuration (sometimes it's useful to have multiple configurations). In case of 1-argument function, or ::tsvector, the default configuration (see show default_text_search_config;) will be taken.

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

Comments

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.