Received: from ural2.hszk.bme.hu (ural2.hszk.bme.hu [152.66.130.2]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8GM2W769006 for ; Sun, 16 Sep 2001 18:02:32 -0400 (EDT) (envelope-from kb136@hszk.bme.hu) Received: (from kb136@localhost) by ural2.hszk.bme.hu (8.11.3/8.11.3) id f8GM2TF08320; Mon, 17 Sep 2001 00:02:29 +0200 (MEST) Date: Mon, 17 Sep 2001 00:02:29 +0200 (MEST) From: Kovacs Baldvin X-X-Sender: To: Subject: Part 2 of "Intentional, or a bug".... Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200109/96 X-Sequence-Number: 4760 Hi again. First of all, tank you for the immediate and precise answers. My solution to the problem was the following. However, I found that to be quite slow. I would like to ask if one can suggest me how to optimize this, because I need this regularly. CREATE FUNCTION gyegyenlo(text, text) RETURNS boolean AS ' SELECT CASE WHEN $1 is null and $2 is null THEN true ELSE ($1) = ($2) END; ' LANGUAGE 'sql'; CREATE OPERATOR ~= ( leftarg = text, rightarg = text, procedure = gyegyenlo, commutator = ~= ); After these I use ~= if I need lines with NULLs in both to be selected. The only problem is that it makes the query very slow. Does anyone knows how to optimize this? Thanks, Baldvin