X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 79DA29FA4E0 for ; Wed, 26 Jul 2006 21:13:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 57959-10 for ; Wed, 26 Jul 2006 21:13:34 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by postgresql.org (Postfix) with ESMTP id 821849FA43C for ; Wed, 26 Jul 2006 21:13:05 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id p77so5415nfc for ; Wed, 26 Jul 2006 17:13:03 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ASm34s+1QkCnVZ1aBNOu/Q+RqwYkPs+Oemu3GfdYwM/S1+JPy0vrij3a5h7aXgsgXzYuXHk3/DI5L0RxZjdVa3kpdFWSFGLQ625QBbsKLKcHBtw9Msp5LG01+I+eWrtqPHzrXrZCLY+j+LOL/WBrQSK2mNpUMptvfKVQBJn7SsQ= Received: by 10.78.167.12 with SMTP id p12mr3514448hue; Wed, 26 Jul 2006 17:13:03 -0700 (PDT) Received: by 10.78.153.11 with HTTP; Wed, 26 Jul 2006 17:13:02 -0700 (PDT) Message-ID: Date: Wed, 26 Jul 2006 20:13:03 -0400 From: "Michael Artz" To: "Bruno Wolff III" , "Michael Artz" , pgsql-sql@postgresql.org Subject: Re: Storing an ordered list In-Reply-To: <20060726203954.GA23437@wolff.to> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20060726203954.GA23437@wolff.to> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200607/328 X-Sequence-Number: 25902 On 7/26/06, Bruno Wolff III wrote: > If you use numeric instead of int, then it is easy to insert new values. Hmm, hadn't thought about that. How would you normally implement it? I'm thinking that, if I wanted to insert between A and B, I could take (A.order + B.order)/2, which would be pretty simple. Is there a better way?