X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C6D8F534BA; Fri, 25 Mar 2005 18:36:41 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 52517-01; Fri, 25 Mar 2005 18:36:24 +0000 (GMT) Received: from mailgate2.igd.fraunhofer.de (mailgate2.igd.fraunhofer.de [192.44.32.14]) by svr1.postgresql.org (Postfix) with ESMTP id 81A66534AA; Fri, 25 Mar 2005 18:36:22 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by mailgate2.igd.fraunhofer.de (Postfix) with ESMTP id 8A65F5DC0; Fri, 25 Mar 2005 19:36:19 +0100 (CET) Received: from webmail.igd.fhg.de (loki.igd.fhg.de [192.44.32.17]) by mailgate2.igd.fraunhofer.de (Postfix) with SMTP id DC6C9F38; Fri, 25 Mar 2005 19:36:15 +0100 (CET) Received: from 146.140.8.144 (SquirrelMail authenticated user vbeddok) by webmail.igd.fraunhofer.de with HTTP; Fri, 25 Mar 2005 19:36:16 +0100 (CET) Message-ID: <2657.146.140.8.144.1111775776.squirrel@webmail.igd.fraunhofer.de> Date: Fri, 25 Mar 2005 19:36:16 +0100 (CET) Subject: Function which gives back the nearest neighbours of a requested value From: "Virgile Beddok" To: pgsql-novice@postgresql.org Cc: pgsql-advocacy@postgresql.org, pgsql-admin@postgresql.org User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Scanned: by amavisd-new at mailgate2.igd.fraunhofer.de X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200503/435 X-Sequence-Number: 16933 Hi! I'm looking for an existing function which allows me to search the nearest neighbours of the requested value. A simple example: if I search the value "2", and my table doesn't contain it, but only contains "0" and "10", as "nearest neighbours", then it will give me back these values : "0" and "10". Could you please tell me if such function already exists in Postgresql, for one-dimensional objects, and also for multi-dimensional objects. Thanks a lot in advance. Virgile Beddok