I'm still having trouble making this work: http://pgsql.privatepaste.com/14a6d3075e CREATE OR REPLACE FUNCTION tsvector_to_tsquery(IN tsv tsvector, op IN char(1), weights IN varchar(4), maxpos IN smallint ) RETURNS tsquery AS 'MODULE_PATHNAME' LANGUAGE C STRICT; What I expect is: tsvector_to_tsquery('java tano', '&', 'ABCD', 100) -> java & tano tsvector_to_tsquery('java:1A,2B tano:3C,4D', '&', 'ABC', 100) -> java:A & java:B & tano:C tsvector_to_tsquery('java:1A,2B tano:3C,4D', '|', 'ABC', 100) -> java:AB | tano:C I've made some improvement compared to previous version I've posted but still it returns an empty tsquery. Things that works: - tsvector_tsquery_size returns reasonable total length of strings and total number of (operand + operator) - curout is actually filled with a lexeme - filters (wf, posmax) work -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general