BUG #15751: Unexpected behaviour at plainto_tsquery funciton

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

BUG #15751: Unexpected behaviour at plainto_tsquery funciton

PG Bug reporting form
The following bug has been logged on the website:

Bug reference:      15751
Logged by:          Ozan Gerdaneri
Email address:      [hidden email]
PostgreSQL version: 11.0
Operating system:   win 10
Description:        

Hi,
My query is like this :
.......
WHERE to_tsvector(COALESCE("blog"."name" )) @@ (plainto_tsquery("cat")) =
true

That is, I am searching for the word "cat" in name column. But the following
error is given. Why is    plainto_tsquery is looking for a column name?
                                                             ^
********** Error **********

ERROR: column "cat" does not exist
SQL state: 42703
Character: 511

Reply | Threaded
Open this post in threaded view
|

Re: BUG #15751: Unexpected behaviour at plainto_tsquery funciton

Daniel Gustafsson-2
> On 13 Apr 2019, at 23:11, PG Bug reporting form <[hidden email]> wrote:

>  
> My query is like this :
> .......
> WHERE to_tsvector(COALESCE("blog"."name" )) @@ (plainto_tsquery("cat")) =
> true
>
> That is, I am searching for the word "cat" in name column. But the following
> error is given. Why is    plainto_tsquery is looking for a column name?
>                                                             ^

Quoted strings become SQL identifiers, what you want to do is using single
quotes in order to make it a string: 'cat'

cheers ./daniel