Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 13E24650054 for ; Tue, 12 Aug 2008 15:52:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 37583-06 for ; Tue, 12 Aug 2008 15:52:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fmailhost02.isp.att.net (fmailhost02.isp.att.net [204.127.217.102]) by postgresql.org (Postfix) with ESMTP id 19C7364FCF4 for ; Tue, 12 Aug 2008 15:52:33 -0300 (ADT) Received: from [127.0.0.1] (adsl-159-88-94.gsp.bellsouth.net[68.159.88.94]) by isp.att.net (frfwmhc02) with ESMTP id <20080812184343H020017rp4e>; Tue, 12 Aug 2008 18:43:43 +0000 X-Originating-IP: [68.159.88.94] Message-ID: <48A1D9DE.1060509@reedyriver.com> Date: Tue, 12 Aug 2008 14:43:42 -0400 From: "H. Hall" User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: PostgreSQL Performance CC: Bill Moran , Steve Atkins Subject: Re: Using PK value as a String References: <18986.60888.qm@web25807.mail.ukl.yahoo.com> <48A15ECF.5030203@sime.com> <87od3ywg4n.fsf@oxford.xeocode.com> <0673579A-B049-4619-B6E4-EE427FB0DDBA@globalinn.com> <1343069D-263F-4D99-BF7E-269C8F0E7F1F@houseofdesign.de> <20080812110416.8e0d6e1c.wmoran@collaborativefusion.com> <4D558373-E7B0-40EC-95EF-FDFE7046ABA2@houseofdesign.de> <20080812112136.72af4bff.wmoran@collaborativefusion.com> <233F1248-E3EA-4572-9310-4E4BC13995DE@blighty.com> <20080812114840.8f7468ed.wmoran@collaborativefusion.com> In-Reply-To: <20080812114840.8f7468ed.wmoran@collaborativefusion.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/134 X-Sequence-Number: 31015 Bill Moran wrote: > In response to Steve Atkins : > > >> On Aug 12, 2008, at 8:21 AM, Bill Moran wrote: >> >> >>> In response to Moritz Onken : >>> >>> >>>> Am 12.08.2008 um 17:04 schrieb Bill Moran: >>>> >>>> >>>>> In response to Moritz Onken : >>>>> >>>>> >>>>>> We chose UUID as PK because there is still some information in an >>>>>> integer key. >>>>>> You can see if a user has registered before someone else >>>>>> (user1.id < >>>>>> user2.id) >>>>>> or you can see how many new users registered in a specific period >>>>>> of >>>>>> time >>>>>> (compare the id of the newest user to the id a week ago). This is >>>>>> information >>>>>> which is in some cases critical. >>>>>> >>>>> So you're accidentally storing critical information in magic values >>>>> instead of storing it explicitly? >>>>> >>>>> Good luck with that. >>>>> >>>> How do I store critical information? I was just saying that it easy >>>> to get some information out of a primary key which is an incrementing >>>> integer. And it makes sense, in some rare cases, to have a PK which >>>> is some kind of random like UUIDs where you cannot guess the next >>>> value. >>>> Interesting. Ordered chronologically and the next value is unguessable. >>> I just repeated your words. Read above "this is information which >>> is in >>> some cases critical." >>> >>> If I misunderstood, then I misunderstood. >>> >>> >> I think Moritz is more concerned about leakage of critical information, >> rather than intentional storage of it. When a simple incrementing >> integer >> is used as an identifier in publicly visible places (webapps, ticketing >> systems) then that may leak more information than intended. >> I think there are better ways to accomplish this than encoding and decoding/decrypting a PK. Store the sensitive data in a session variable or store session data in the database neither of which is accessible to users. It is usually a big mistake to de-normalize a table by encoding several fields in a single column PK or not. If you want to do something with the encoded data such as find one or more rows with an encoded value then you will have to inspect every row and decode it and then compare it or add it or whatever. > > Then I did misunderstand. > > -- H. Hall ReedyRiver Group LLC http://www.reedyriver.com