Received: from shaked.cc.openu.ac.il (shaked.cc.openu.ac.il [147.233.145.65]) by hub.org (8.9.1/8.9.1) with ESMTP id HAA24785 for ; Tue, 15 Dec 1998 07:37:00 -0500 (EST) (envelope-from herouth@oumail.openu.ac.il) Received: from [147.233.159.109] (herouth@mac-herouth.pc.openu.ac.il [147.233.159.109]) by shaked.cc.openu.ac.il (8.8.8/8.8.8) with ESMTP id OAA14958; Tue, 15 Dec 1998 14:36:07 +0200 (IST) X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: <01be2731$721f7ea0$261313d4@dvs.rybvod.kamchatka.su> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Tue, 15 Dec 1998 14:37:46 +0200 To: "Vladimir Dobrokhotov" , From: Herouth Maoz Subject: Re: [SQL] binary search At 9:14 +0200 on 14/12/98, Vladimir Dobrokhotov wrote: > I didn't find in documentation how to do binary search. > I want to find records where (int2_field AND 8)=TRUE (8). > Is this possible? Can I use index? This is not binary search. Binary search is a search method in which you eliminate half your search domain in each iteration. If I am reading you right, you want to be able to perform bit-wise operators. such as bitwise or (like in C: num1 | num2), bitwise and (num1 & num2), bitwise not and shifts (num1 >> 3, num1 << 8). I think such operators don't exist in the core PostgreSQL package, though you may well design them yourself in C. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma