ts_rank error/result of '1e-020'

Started by Henry Drexlerover 14 years ago4 messagesgeneral
Jump to latest
#1Henry Drexler
alonup8tb@gmail.com

I have a workaround to the error/result, but am wondering what the result of
ts_rank of '1e-020' represents?

Here is the original:

select
ts_rank(to_tsvector('a_a_do_ug_read_retreqmon_ptam'),to_tsquery('a_a_do_ug_read_retrmso.com_ptam'))

#2Henry Drexler
alonup8tb@gmail.com
In reply to: Henry Drexler (#1)
Re: ts_rank error/result of '1e-020'

it sent before I finished, here is the rest:

I have fixed this by doing the following:

select
ts_rank(to_tsvector(replace('a_a_do_ug_read_retreqmon_ptam','_','
')),plainto_tsquery(replace('a_a_do_ug_read_retrmso.com_ptam','_',' ')))

so I have found a solution, just wondering what the earlier error means/what
causes it. I could not find any references to that error in documentation
or in help searches.

#3Henry Drexler
alonup8tb@gmail.com
In reply to: Henry Drexler (#1)
Re: ts_rank error/result of '1e-020'

On Thu, Oct 6, 2011 at 4:37 PM, Gavin Flower
<GavinFlower@archidevsys.co.nz>wrote:

On 07/10/11 01:40, Henry Drexler wrote:

I have a workaround to the error/result, but am wondering what the result
of ts_rank of '1e-020' represents?

Here is the original:

select
ts_rank(to_tsvector('a_a_do_**ug_read_retreqmon_ptam'),to_**
tsquery('a_a_do_ug_read_**retrmso.com_ptam'))

I get essentialy the same result with pg 9.1.1

----------------
9.99999968e-21
(1 row)

gavin=>

I am also on "PostgreSQL 9.1.1"

Thanks for posting the 9.99999968e-21, I did not realize it was using
notation to represent a number, I thought it was an error code. That is
good news - thank you for taking the time ans showing me your result - that
solves it.

#4Gavin Flower
GavinFlower@archidevsys.co.nz
In reply to: Henry Drexler (#3)
Re: ts_rank error/result of '1e-020'

On 07/10/11 10:56, Henry Drexler wrote:

On Thu, Oct 6, 2011 at 4:37 PM, Gavin Flower
<GavinFlower@archidevsys.co.nz <mailto:GavinFlower@archidevsys.co.nz>>
wrote:

On 07/10/11 01:40, Henry Drexler wrote:

I have a workaround to the error/result, but am wondering what
the result of ts_rank of '1e-020' represents?

Here is the original:

select
ts_rank(to_tsvector('a_a_do_ug_read_retreqmon_ptam'),to_tsquery('a_a_do_ug_read_retrmso.com_ptam'))

I get essentialy the same result with pg 9.1.1

----------------
9.99999968e-21
(1 row)

gavin=>

I am also on "PostgreSQL 9.1.1"

Thanks for posting the 9.99999968e-21, I did not realize it was
using notation to represent a number, I thought it was an error code.
That is good news - thank you for taking the time ans showing me your
result - that solves it.

You're welcome.

It is amazing how 'trivial' things can have such significant effects - I
once took a few hours to spot an extra ';' in a short C program that
wasn't doing what it was meant to do!

In postgresql.conf I have:
extra_float_digits = 3 # min -15, max 3
the default is zero.

This might explain the difference in output.