Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/pkgsite: pq: function websearch_to_tsquery(unknown) does not exist #43154

Closed
oiooj opened this issue Dec 12, 2020 · 4 comments
Closed

x/pkgsite: pq: function websearch_to_tsquery(unknown) does not exist #43154

oiooj opened this issue Dec 12, 2020 · 4 comments

Comments

@oiooj
Copy link
Member

@oiooj oiooj commented Dec 12, 2020

I inited a DB and test pkgsite but when I search a keyword I got an error, a pg function not found: websearch_to_tsquery(unknown).

2020/12/12 23:07:54 Error: fetchSearchPage(ctx, db, "http"): DB.Search(ctx, "http", 10, 0): "deep" search failed: DB running query local-6: pq: function websearch_to_tsquery(unknown) does not exist
2020/12/12 23:07:54 Info: 500 /search map[isRobot:false requestType:request end]

image

I inited the database using migrations/*.up.sql files, Did I miss something?
Is there any guide to run this service for developing. Thanks.

/cc @julieqiu

@oiooj oiooj added the pkgsite label Dec 12, 2020
@gopherbot gopherbot added this to the Unreleased milestone Dec 12, 2020
@julieqiu julieqiu removed their assignment Dec 12, 2020
@jba
Copy link
Contributor

@jba jba commented Dec 14, 2020

That is not one of our functions; it's built in to Postgres.

Try this from psql or other DB client:

select websearch_to_tsquery('foo'); 

If that fails, perhaps you have an older version of Postgres? We're on version 11.

If it succeeds, maybe there's a problem with the argument. Can you figure out what's being passed to the function?

@jba
Copy link
Contributor

@jba jba commented Dec 14, 2020

Is there any guide to run this service for developing.

https://go.googlesource.com/pkgsite/+/master/doc/postgres.md is the best we have at the moment. Enhancements welcome.

@jba jba added the WaitingForInfo label Dec 14, 2020
@jba jba modified the milestones: Unreleased, pkgsite/unplanned Dec 14, 2020
@oiooj
Copy link
Member Author

@oiooj oiooj commented Dec 15, 2020

Yes , this function added in PostgreSQL 11, doc: https://www.postgresql.org/docs/11/functions-textsearch.html
Thanks @jba

@oiooj oiooj closed this Dec 15, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Dec 15, 2020

Change https://golang.org/cl/278292 mentions this issue: doc: clarify that Postgres v11 or higher is required

gopherbot pushed a commit to golang/pkgsite that referenced this issue Dec 15, 2020
See golang/go#43154, where an older version was missing a function we
use.

Change-Id: I268b5ded629bf10504bb2418843978f21c15f483
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/278292
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants