Re: Query on a record variable - Mailing list pgsql-general

From Giuseppe Broccolo
Subject Re: Query on a record variable
Date
Msg-id [email protected]
Whole thread Raw
In response to Query on a record variable  ("Janek Sendrowski" <[email protected]>)
List pgsql-general
Hi Janek,

> Hi,
>
> ok :)

I suppose you have a table 'table' with 'col' (text), 'dede' (text) and
'vectors' (tsvector) as fields. In this case, you can do

SELECT levenshtein(col, 'string') FROM table AS lev WHERE
levenshtein(col, 'string') < 10 AND LENGTH(dede) BETWEEN x AND y AND
plainto_tsquery('string') @@ vectors;

Hope it can help.

Giuseppe.

--
Giuseppe Broccolo - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
[email protected] | www.2ndQuadrant.it



pgsql-general by date:

Previous
From: Luca Ferrari
Date:
Subject: Re: Denormalized field
Next
From: Robert Sosinski
Date:
Subject: Re: Memory Issue with array_agg?