Search Postgresql Archives

Query on a record variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

How can I do a query on a record variable in a function.
I want to do a dirty fulltextsearch on a table and then choose the string which have a low levenshtein-distance.
I wanted to it like this, but it doesn't work:

v_query := 'SELECT col FROM table WHERE LENGTH(dede) BETWEEN x AND y AND plainto_tsquery(string') @@ vectors';
EXECUTE v_query INTO v_rec;
v_query :=   'SELECT levenshtein('string', v_rec.col) AS lev WHERE levenshtein('string', v_rec.col) < 10';
EXECUTE v_query INTO v_rec2;

Or is there an easier way to do that. Maybe just to do one query at once?

Hope someone can help me.

Janek Sendrowski


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux