You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start up a docker container with bitnami/postgresql:latest (first discovered this running tag 15.4.0 though)
docker run -p 5432:5432 -e POSTGRESQL_PASSWORD=postgres -d bitnami/postgresql
Using your preferred Postgres client connect to server in that docker container (default "postgres" database is fine).
psql -h localhost -p 5432 -U postgres
Login using password "postgres" and execute the following query:
SELECT
to_tsvector('pg_catalog.english', 'title here the body text is here'),
to_tsquery('title & body') as search_query,
to_tsvector('pg_catalog.english', 'title here the body text is here') @@ to_tsquery('title & body') AS has_match
The "expected behaviour" was taken from a docker container running the latest official postgres image (was version 17.2). However, I also saw this result using official postgres 15.4, 15.6 and 16.
It might be just a coincidence but I also saw reproduced the "bug" behaviour on an Amazon RDS instance running postgres 15.4.
Further findings. It seems like the when the official postgres image picked up that my default_text_search_config should be "english" instead of "simple". By creating my query like so to_tsquery('english', 'title & body') I was able to see the expected result. This is a suitable workaround for my purposes.
I still wonder why there is a difference in behaviour. 🤔
Hi @quinlanjager, thanks for using bitnami containers
I tried to reproduce the issue you share but I couldn't. These are the steps I followed and the results:
$ docker run --rm --name bitnami -d -e ALLOW_EMPTY_PASSWORD=yes bitnami/postgresqla1f309fd0898c7cf6b76d1f8337f624a796fe7abedc365b62779ff05ce5e75b6
$ docker exec -it bitnami psql -U postgrespsql (17.0)Type "help" for help.postgres=# SELECTpostgres-# to_tsvector('pg_catalog.english', 'title here the body text is here'),postgres-# to_tsquery('title & body') as search_query,postgres-# to_tsvector('pg_catalog.english', 'title here the body text is here') @@ to_tsquery('title & body') AS has_matchpostgres-# ; to_tsvector | search_query | has_match----------------------------+------------------+----------- 'bodi':4 'text':5 'titl':1 | 'title' & 'body' | f(1 row)postgres=#
Are you using an existing database? Not sure if the issue could be relate to your locale configuration.
Name and Version
bitnami/postgresql:latest
What architecture are you using?
arm64
What steps will reproduce the bug?
What is the expected behavior?
What do you see instead?
Additional information
The "expected behaviour" was taken from a docker container running the latest official postgres image (was version 17.2). However, I also saw this result using official postgres 15.4, 15.6 and 16.
It might be just a coincidence but I also saw reproduced the "bug" behaviour on an Amazon RDS instance running postgres 15.4.
The query itself is adapted from Postgres' documentation.
The text was updated successfully, but these errors were encountered: