Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1erU66-00041A-8N for pgsql-general@arkaria.postgresql.org; Thu, 01 Mar 2018 19:42:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1erU65-00045w-7L for pgsql-general@arkaria.postgresql.org; Thu, 01 Mar 2018 19:42:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1erU64-00045n-VQ for pgsql-general@lists.postgresql.org; Thu, 01 Mar 2018 19:42:33 +0000 Received: from eastrmfepo102.cox.net ([68.230.241.214]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1erU5t-0001Nu-SW for pgsql-general@lists.postgresql.org; Thu, 01 Mar 2018 19:42:29 +0000 Received: from eastrmimpo305.cox.net ([68.230.241.237]) by eastrmfepo102.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20180301194218.HMIX24661.eastrmfepo102.cox.net@eastrmimpo305.cox.net> for ; Thu, 1 Mar 2018 14:42:18 -0500 Received: from [192.168.1.10] ([70.171.109.83]) by eastrmimpo305.cox.net with cox id GjiJ1x00M1o04Vy01jiJU8; Thu, 01 Mar 2018 14:42:18 -0500 X-Authority-Analysis: v=2.2 cv=ZJOnoTzb c=1 sm=1 tr=0 a=uCHdjGDeLqaieW9t8IbZ6A==:117 a=uCHdjGDeLqaieW9t8IbZ6A==:17 a=IkcTkHD0fZMA:10 a=x7bEGLp0ZPQA:10 a=qk9vRrhBYGxZ3-alj_4A:9 a=QEXdDO2ut3YA:10 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (PLAIN) smtp.auth=ron.l.johnson@cox.net Subject: Re: Enforce primary key on every table during dev? To: pgsql-general@lists.postgresql.org References: <161e1761560-58a6-18e4b@webjas-vad211.srv.aolmail.net> <5a1870db-7018-fe15-ac60-ffe37abb7077@cox.net> <5da96fe6-666b-1107-ee76-b464417bd1b7@cox.net> From: Ron Johnson Message-ID: <121bb8e7-7e33-81ff-f0d2-cad4d799595d@cox.net> Date: Thu, 1 Mar 2018 13:42:18 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 03/01/2018 01:11 PM, marcelo wrote: > > On 01/03/2018 16:00 , Ron Johnson wrote: [snip] >> If your only unique index is a synthetic key, then you can insert the >> same "business data" multiple times with different synthetic keys. >> >> >> -- >> Angular momentum makes the world go 'round. > IMHO, business logic can and must preclude "garbage insertion". Except you > are inserting data directly to database using SQL, any n-tier architecture > will be checking data validity. Any n-tier architecture that's bug-free. -- Angular momentum makes the world go 'round.