pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron Johnson <ron.l.johnson@cox.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Enforce primary key on every table during dev?
Date: Thu, 1 Mar 2018 14:21:18 -0600
Message-ID: <796df4ca-62b8-c574-6b1b-742aa401250a@cox.net> (raw)
In-Reply-To: <Gk991x09V1DF5NZ01k9BG0>
References: <C9EFC294-83B5-41FD-9542-60FDBB2588C6@gmail.com>
	<161e1761560-58a6-18e4b@webjas-vad211.srv.aolmail.net>
	<5a1870db-7018-fe15-ac60-ffe37abb7077@cox.net>
	<GiZ41x00v1DF5NZ01iZ5Ez>
	<5da96fe6-666b-1107-ee76-b464417bd1b7@cox.net>
	<GjBK1x03w1DF5NZ01jBMsX>
	<121bb8e7-7e33-81ff-f0d2-cad4d799595d@cox.net>
	<Gk991x09V1DF5NZ01k9BG0>

On 03/01/2018 02:08 PM, marcelo wrote:
>
>
> On 01/03/2018 16:42 , Ron Johnson wrote:
>> 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.
>>
> Do you know about unit testing?

Way Back When Dinosaurs Still Roamed The Earth and I first learned the 
trade, the focus was on proper design instead of throwing crud against the 
wall and hoping tests caught any bugs.  Because, of course, unit tests are 
only as good as you imagination in devising tests.


-- 
Angular momentum makes the world go 'round.




view thread (59+ messages)  latest in thread

Message-ID: <796df4ca-62b8-c574-6b1b-742aa401250a@cox.net>
Permalink:  ../796df4ca-62b8-c574-6b1b-742aa401250a@cox.net/
Also on:    postgresql.org/message-id/796df4ca-62b8-c574-6b1b-742aa401250a@cox.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ron.l.johnson@cox.net
  Subject: Re: Enforce primary key on every table during dev?
  In-Reply-To: <796df4ca-62b8-c574-6b1b-742aa401250a@cox.net>
  References: <C9EFC294-83B5-41FD-9542-60FDBB2588C6@gmail.com> <161e1761560-58a6-18e4b@webjas-vad211.srv.aolmail.net> <5a1870db-7018-fe15-ac60-ffe37abb7077@cox.net> <GiZ41x00v1DF5NZ01iZ5Ez> <5da96fe6-666b-1107-ee76-b464417bd1b7@cox.net> <GjBK1x03w1DF5NZ01jBMsX> <121bb8e7-7e33-81ff-f0d2-cad4d799595d@cox.net> <Gk991x09V1DF5NZ01k9BG0> <796df4ca-62b8-c574-6b1b-742aa401250a@cox.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox