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

From Giuseppe Broccolo
Subject Re: Query on a record variable
Date
Msg-id 5211F10D.7050701@2ndquadrant.it
Whole thread Raw
In response to Query on a record variable  ("Janek Sendrowski" <janek12@web.de>)
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
giuseppe.broccolo@2ndQuadrant.it | 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?