pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
to_tsvector() chopping off trailing 's' characters
4+ messages / 2 participants
[nested] [flat]

* to_tsvector() chopping off trailing 's' characters
@ 2019-11-01 18:28  Wells Oliver <wells.oliver@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Wells Oliver @ 2019-11-01 18:28 UTC (permalink / raw)
  To: pgsql-admin

I don't understand this behavior in 12 (worked in 9.6), but:

select 'Thames', to_tsvector('John Thames');

Gives you a vector of: 'john':1 'thame':2

And searching for the full 'Thames' returns no results.

What's happening here?

-- 
Wells Oliver
wells.oliver@gmail.com <wellsoliver@gmail.com>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: to_tsvector() chopping off trailing 's' characters
@ 2019-11-01 18:35  Wells Oliver <wells.oliver@gmail.com>
  parent: Wells Oliver <wells.oliver@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Wells Oliver @ 2019-11-01 18:35 UTC (permalink / raw)
  To: pgsql-admin

Sorry for the follow up, meant to add I tried this:

select 'Thames', to_tsvector('simple', 'fat cats ate rats');

And it throws: ERROR:  invalid input syntax for type oid: "simple"

Even though doing \dF in psql shows that 'simple' is available in the list
of text search configurations.


On Fri, Nov 1, 2019 at 11:28 AM Wells Oliver <wells.oliver@gmail.com> wrote:

> I don't understand this behavior in 12 (worked in 9.6), but:
>
> select 'Thames', to_tsvector('John Thames');
>
> Gives you a vector of: 'john':1 'thame':2
>
> And searching for the full 'Thames' returns no results.
>
> What's happening here?
>
> --
> Wells Oliver
> wells.oliver@gmail.com <wellsoliver@gmail.com>
>


-- 
Wells Oliver
wells.oliver@gmail.com <wellsoliver@gmail.com>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: to_tsvector() chopping off trailing 's' characters
@ 2019-11-01 18:54  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Wells Oliver <wells.oliver@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2019-11-01 18:54 UTC (permalink / raw)
  To: Wells Oliver <wells.oliver@gmail.com>; +Cc: pgsql-admin

Wells Oliver <wells.oliver@gmail.com> writes:
> Sorry for the follow up, meant to add I tried this:
> select 'Thames', to_tsvector('simple', 'fat cats ate rats');
> And it throws: ERROR:  invalid input syntax for type oid: "simple"

That works for me.  I suspect you've got some nonstandard versions
of to_tsvector() hanging about.  There should only be

regression=# \df to_tsvector
                            List of functions
   Schema   |    Name     | Result data type | Argument data types | Type 
------------+-------------+------------------+---------------------+------
 pg_catalog | to_tsvector | tsvector         | json                | func
 pg_catalog | to_tsvector | tsvector         | jsonb               | func
 pg_catalog | to_tsvector | tsvector         | regconfig, json     | func
 pg_catalog | to_tsvector | tsvector         | regconfig, jsonb    | func
 pg_catalog | to_tsvector | tsvector         | regconfig, text     | func
 pg_catalog | to_tsvector | tsvector         | text                | func
(6 rows)

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: to_tsvector() chopping off trailing 's' characters
@ 2019-11-01 19:00  Wells Oliver <wells.oliver@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Wells Oliver @ 2019-11-01 19:00 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin

Yeah, odd. I must have borked this somehow, probably remnants of an older
installation. I have two PG 12 servers, one where 'simple' works, which has:

   Schema   |    Name     | Result data type | Argument data types | Type
------------+-------------+------------------+---------------------+------
 pg_catalog | to_tsvector | tsvector         | json                | func
 pg_catalog | to_tsvector | tsvector         | jsonb               | func
 pg_catalog | to_tsvector | tsvector         | regconfig, json     | func
 pg_catalog | to_tsvector | tsvector         | regconfig, jsonb    | func
 pg_catalog | to_tsvector | tsvector         | regconfig, text     | func
 pg_catalog | to_tsvector | tsvector         | text                | func

And the one where it's borked:

   Schema   |    Name     | Result data type | Argument data types | Type
------------+-------------+------------------+---------------------+------
 pg_catalog | to_tsvector | tsvector         | json                | func
 pg_catalog | to_tsvector | tsvector         | jsonb               | func
 pg_catalog | to_tsvector | tsvector         | regconfig, json     | func
 pg_catalog | to_tsvector | tsvector         | regconfig, jsonb    | func
 pg_catalog | to_tsvector | tsvector         | regconfig, text     | func
 pg_catalog | to_tsvector | tsvector         | text                | func
 public     | to_tsvector | tsvector         | oid, text           | func

Seems that public function is the weirdo remnant breaking things. I ...
think... I can just drop public.to_tsvector, right?




On Fri, Nov 1, 2019 at 11:54 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Wells Oliver <wells.oliver@gmail.com> writes:
> > Sorry for the follow up, meant to add I tried this:
> > select 'Thames', to_tsvector('simple', 'fat cats ate rats');
> > And it throws: ERROR:  invalid input syntax for type oid: "simple"
>
> That works for me.  I suspect you've got some nonstandard versions
> of to_tsvector() hanging about.  There should only be
>
> regression=# \df to_tsvector
>                             List of functions
>    Schema   |    Name     | Result data type | Argument data types | Type
> ------------+-------------+------------------+---------------------+------
>  pg_catalog | to_tsvector | tsvector         | json                | func
>  pg_catalog | to_tsvector | tsvector         | jsonb               | func
>  pg_catalog | to_tsvector | tsvector         | regconfig, json     | func
>  pg_catalog | to_tsvector | tsvector         | regconfig, jsonb    | func
>  pg_catalog | to_tsvector | tsvector         | regconfig, text     | func
>  pg_catalog | to_tsvector | tsvector         | text                | func
> (6 rows)
>
>                         regards, tom lane
>


-- 
Wells Oliver
wells.oliver@gmail.com <wellsoliver@gmail.com>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2019-11-01 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-01 18:28 to_tsvector() chopping off trailing 's' characters Wells Oliver <wells.oliver@gmail.com>
2019-11-01 18:35 ` Wells Oliver <wells.oliver@gmail.com>
2019-11-01 18:54   ` Tom Lane <tgl@sss.pgh.pa.us>
2019-11-01 19:00     ` Wells Oliver <wells.oliver@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox