Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8889895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:22:31+00:00 2026-06-14T22:22:31+00:00

I have the following tsvector update trigger for a tsvector column ‘user_tsv’ on a

  • 0

I have the following tsvector update trigger for a tsvector column ‘user_tsv’ on a table that allows me to perform full text searches,

CREATE TRIGGER tsvector_user_update BEFORE INSERT OR UPDATE ON users
FOR EACH ROW EXECUTE PROCEDURE 
tsvector_update_trigger(user_tsv, 'pg_catalog.english', firstname, surname, email);
CREATE INDEX user_index_tsv ON users USING gin(user_tsv);

I have since added another column to the table that I want to include in this trigger, is there any way to update the trigger (and also the tsvector column) or do I need to drop the column / trigger and re-add them?

PostgreSQL 9.0

Thanks in advance

David

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:22:33+00:00Added an answer on June 14, 2026 at 10:22 pm

    You don’t need to drop the column or the index, just drop and re-create the trigger and update any changed fields.

    Drop the trigger with a regular DROP TRIGGER statement, then re-create it with the new column using tsvector_update_trigger, all in the same transaction. Now UPDATE tablename SET user_tsv = ... WHERE new_column IS NOT NULL to update the column if you’ve already added columns. Examine the sources for the tsvector update trigger to find out the appropriate expression to use in the assignment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following method that I select all the ids from table and append
I have following script that executes all the .reg files in the current directory.
I have following CSS: table tbody tr:last-child td { padding-top: 7px; border-bottom: 0; }
I was following the documentation on FullTextSearch in postgresql. I've created a tsvector column
I have an Ruby on Rails 3 Heroku application, which needs to perform text
I have following code that creates Linq query. I've never used Linq until today
I have following table it shows like this: ABC A B C 123 Hello
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following text in a file 23456789 When I tried to replace the
I have following table structure in my DB ID Name -------------------------- ID_1 Name1 ID1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.