Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUD1V-0004rT-3q for pgsql-general@arkaria.postgresql.org; Wed, 07 Apr 2021 18:35:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lUD1T-00080x-Ku for pgsql-general@arkaria.postgresql.org; Wed, 07 Apr 2021 18:35:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUD1T-00080q-AG for pgsql-general@lists.postgresql.org; Wed, 07 Apr 2021 18:35:27 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lUD1O-0004b5-Kq for pgsql-general@lists.postgresql.org; Wed, 07 Apr 2021 18:35:26 +0000 Received: by mail-oi1-x235.google.com with SMTP id n140so19745140oig.9 for ; Wed, 07 Apr 2021 11:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=EseqP3o2YHTFIeizKeNpb7OmnuczOki++CSjAYWBSWA=; b=HvdgttJtk70qXe9e1npQT7urkIilQRK8ojLyRZATZR/919KAqZadcgqgilfv1leJRn i8ubWsPfRtUUVCI9+w0SIqekF95x0yaRGy6UyOKeXNoxt8sP3qE0doBIktYFcQjq+w3e 5qJtR01jQs21F5P2mmxSjXsy5AkzgGG2Wibi3jBjmSw8yGXYTHQzHNt/D6vuG0eIROlW oz3aDAvzDIkMyjqiL1qLGVzkFY5W7Dn6iT8lr8QrbNJBvRkV2vKd6U1OZCJLla8eo0H/ bfa3rUDTCEzzRBeIaiCiClNTYbEG4vI8dA9qG9IJGEor8nFjWjYPq/If+O/vmd0k/Z6y JOaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=EseqP3o2YHTFIeizKeNpb7OmnuczOki++CSjAYWBSWA=; b=UfHI8H0h9eOKTYNHHbP8BEK7U3vZnk/oteO1t4Z4PZJoL0TTs7WsuWAvcUe/zMPHy0 7TjSCh26YrlbOUaV8/Oj2XxXjBeEmTlWxYIZGcP1oQ+EwN4PG9mVbDTyy22bea+4XT3b L2kI3gCE/wyALmTbtwUKikv7ejgBu6RzJX2Y7M0+9GIE92SeEESL4wCWr1No1yxFn7KL QllmdJX30BgizuxejvC/wmez1e7NQCUicYC9Z48jIpaHGjofdBnxVHLPZzap4tvCi1ZW mq/olIlQW7awhSgLaEB94ykfD3aVm80s0aYZNpRYkf3pJi/cpee3r4ZMOdU5TIQuGqvN CdqQ== X-Gm-Message-State: AOAM5332SLg2ocqui00mwLw99flLPw3uvLXzNudvVkQRFj4bndhYdfoq SAsetXh+5wAvO2SQcM9L7MsHOqEaOrU= X-Google-Smtp-Source: ABdhPJyA/R08gQAVFm1640NuMvSgW4fuLeIdqRgb4vlFltGMXiMcc7f1QDqkWpBB69xV7PqRu0U9eA== X-Received: by 2002:a05:6808:f12:: with SMTP id m18mr3051226oiw.62.1617820520450; Wed, 07 Apr 2021 11:35:20 -0700 (PDT) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id a6sm5588712otb.41.2021.04.07.11.35.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Apr 2021 11:35:19 -0700 (PDT) Subject: Re: Primary keys and composite unique keys(basic question) To: pgsql-general@lists.postgresql.org References: <3fcf7329-378d-6982-89d9-a3f28ada0d47@gmail.com> <9FFB0361-5256-4175-9C51-5D9F6E6969D9@gmail.com> <8ab79f7a-f5bf-98c4-03e8-b3918c542594@gmail.com> From: Ron Message-ID: <09cdd33e-24ed-f51c-84fd-1955c42a0d84@gmail.com> Date: Wed, 7 Apr 2021 13:35:15 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------3F320DE3680AF33D4FCF1C0B" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------3F320DE3680AF33D4FCF1C0B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 4/7/21 1:16 PM, Rob Sargent wrote: > On 4/7/21 11:59 AM, Ron wrote: >> On 4/7/21 11:35 AM, Rob Sargent wrote: >>> >>>> On Apr 7, 2021, at 10:17 AM, Ron wrote: >>>> >>>>  On 4/5/21 9:37 PM, Rob Sargent wrote: >>>>>> It's a small thing, but UUIDs are absolutely not memorizable by >>>>>> humans; they have zero semantic value.  Sequential numeric identifiers >>>>>> are generally easier to transpose and the value gives some clues to >>>>>> its age (of course, in security contexts this can be a downside). >>>>>> >>>>> I take the above as a definite plus.  Spent too much of my life >>>>> correcting others’ use of “remembered” id’s that just happened to >>>>> perfectly match the wrong thing. >>>> >>>> People seem to have stopped appending check digits to identifiers about >>>> 20 years ago, and I'm not sure why. >>>> >>> No the problem is “start from one”. User has item/I’d 10875 in hand and >>> types in 10785 which of course in a sequence supplied ID steam is >>> perfectly valid and wrong.  Really hard to track down. >> >> That's my point.  Adding a check digit (turning 10875 into 108753) would >> have caught that, since 107853 does not match 107854 (which is 10785 with >> a check digit added). > Well you forget that 108753 is also a number in the series from 1 to > maxint.   Maybe you're on to something though: a checksum dispensing sequence! Call a function which reads the next value from the sequence, appends the check digit and returns that number.  We were doing that 25 years ago. -- Angular momentum makes the world go 'round. --------------3F320DE3680AF33D4FCF1C0B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 4/7/21 1:16 PM, Rob Sargent wrote:
On 4/7/21 11:59 AM, Ron wrote:
On 4/7/21 11:35 AM, Rob Sargent wrote:

On Apr 7, 2021, at 10:17 AM, Ron <ronljohnsonjr@gmail.com> wrote:

 On 4/5/21 9:37 PM, Rob Sargent wrote:
It's a small thing, but UUIDs are absolutely not memorizable by
humans; they have zero semantic value.  Sequential numeric identifiers
are generally easier to transpose and the value gives some clues to
its age (of course, in security contexts this can be a downside).

I take the above as a definite plus.  Spent too much of my life correcting others’ use of “remembered” id’s that just happened to perfectly match the wrong thing.

People seem to have stopped appending check digits to identifiers about 20 years ago, and I'm not sure why.

No the problem is “start from one”. User has item/I’d 10875 in hand and types in 10785 which of course in a sequence supplied ID steam is perfectly valid and wrong.  Really hard to track down.

That's my point.  Adding a check digit (turning 10875 into 108753) would have caught that, since 107853 does not match 107854 (which is 10785 with a check digit added).
Well you forget that 108753 is also a number in the series from 1 to maxint.   Maybe you're on to something though: a checksum dispensing sequence!

Call a function which reads the next value from the sequence, appends the check digit and returns that number.  We were doing that 25 years ago.

--
Angular momentum makes the world go 'round.
--------------3F320DE3680AF33D4FCF1C0B--