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 1mF23n-0004Yk-5b for pgsql-general@arkaria.postgresql.org; Sat, 14 Aug 2021 22:23:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mF23l-0000b0-8Z for pgsql-general@arkaria.postgresql.org; Sat, 14 Aug 2021 22:23:21 +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 1mF23j-0000as-Oc for pgsql-general@lists.postgresql.org; Sat, 14 Aug 2021 22:23:20 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mF23d-0007TY-Dp for pgsql-general@lists.postgresql.org; Sat, 14 Aug 2021 22:23:19 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E64365C00BD; Sat, 14 Aug 2021 18:23:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 14 Aug 2021 18:23:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=D v16nLxHEQjFWZSDQPAeRdcWK/NnaBcQRD7pVbhR504=; b=bSb3Q2PCFvuum3jNK 23l4Ztskw82DJiTqNQN/oZXDKicNqCPyKMKDrzIoTjACldP6wMnODP1kWL9VUM3M +qOjQj4hkdvPVmbVxzp/fUDH6VnCb+w6z+AvBHkSjex7fGgLppGItH45f4lV2Wum X7vh5+xP9QCQEtkoe8y+725eLXPqvWNR8KVZkrLD1NzWjUdB4WDcCHg6f4jVQR+2 5d8646E1aaigoFm9cL69hGxvpJUGcZpCwuRJjtG2VWsEgEZJX6Rshc+IJIcHB0d2 94wMPHlTD3jWv8cDW0+vhkZt8yEPU3LX/OAWAdczG9sJMiNDp5RK8jvxtzqv6PQd QDs5w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=Dv16nLxHEQjFWZSDQPAeRdcWK/NnaBcQRD7pVbhR5 04=; b=r0Es6sS7OXrFFz2uGQW3mRlfNfLHca9hKbd8O0vg/R4w/lLS8mwM5h0YX HapK3Lish0K61eiEFDec6jkEBJQ1E+C3aKOJpIaSDIh1qR4Sou8WuEs2Q6UTvuDH 4/4bvaDx0u1ANqgvu7SFbj3E9ESNOic2b5gNKRX2v8+MQ288M0+7v+t1MUmed/l1 3KSZ9qwOpVJr7B3preqwdojRIfYmH8vBoMDTpApTTIV0iXdGG6T2nk+lK7Rnr/B4 XTaPOcc7tbnYlUMhmmko6CDs3L9Ali/CTvOU/Y4wifuZoGgFYAPJvzJoNTjgzUhy WZi33SsnUv5kkXElkEKBVJbMSI3Rw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrkeekgddutdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepuddufeejteevffehgfduhedthfdvteekieeuheefveev udetkeelueehgeduhefhnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgr nhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 14 Aug 2021 18:23:09 -0400 (EDT) Subject: Re: Sort question - Fractions, Metric etc To: Bret Stern , pgsql-general@lists.postgresql.org References: <57f60e61-114f-c403-b2e2-820e76f08d64@machinemanagement.com> <702e71c6-5091-9c65-87c0-e4599dddd376@gmail.com> <643df9bf-7378-93fb-1c8c-fe31f08ec214@machinemanagement.com> <434282c4-dc47-d5f2-9ade-c493bdb09074@machinemanagement.com> <2987852b-bab3-db5a-bf3f-d78081b14d1b@aklaver.com> <6ddf1160-68d2-7aea-8627-2b122a5fd339@machinemanagement.com> From: Adrian Klaver Message-ID: <21c49a99-b0e8-35ef-e31a-872c2960c414@aklaver.com> Date: Sat, 14 Aug 2021 15:23:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <6ddf1160-68d2-7aea-8627-2b122a5fd339@machinemanagement.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/14/21 2:47 PM, Bret Stern wrote: > > On 8/14/2021 2:13 PM, Adrian Klaver wrote: >> On 8/14/21 2:04 PM, Bret Stern wrote: > Vendors supply dimensions, depending on where in the world the product > comes from, could be metric, imperial > > or fraction > >> Yes, nominal dimensions. That is what I'm trying to work out, is this >> something that makes sense to the vendor and should not be tampered with? >> > The vendor is out of the picture at this point. They provide a catalog, > and we enter (or import) items into our POS system. We match their > dimension within tolerance. > It would seem then a entry system that specifies the initial input unit(metric, imperial) and then does the conversion to a set unit(my preference would be metric) for storage to the table in that unit. Then you would convert on the fly to fill out the display field. Or you could use something like generated columns(https://www.postgresql.org/docs/12/ddl-generated-columns.html) available in Postgres 12+ to pre-fill columns to save the overhead on subsequent queries. For pre-12 maybe a trigger on the table column to fill in the other columns. In any case you sort(order by) by your canonical column which would be of numeric type. > No. Slabs eg granite, slate, dolemite, marble..cut from larger blocks > and delivered in blocks of ten slabs normally, where tolerances are > also  +/- .032 > > I will say this business has been behind in the attributes game. Plus > there are many "artsy" vendors > > who can hardly speak in these terms, and don't publish to us, so we do > the best we can. > > Getting vendors to supply the basic values is a struggle. > >> >>> >>> a 32nd or so. >>> >>> cheers >>> >>> >>> >>> >> >> >> > > -- Adrian Klaver adrian.klaver@aklaver.com