pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rakesh Kumar <rakeshkumar464@aol.com>
To: haramrae@gmail.com
To: melvin6925@gmail.com
Cc: theophilusx@gmail.com
Cc: finzelj@gmail.com
Cc: pgsql-general@postgresql.org
Subject: Re: Enforce primary key on every table during dev?
Date: Thu, 1 Mar 2018 07:07:47 -0500
Message-ID: <161e1761560-58a6-18e4b@webjas-vad211.srv.aolmail.net> (raw)
In-Reply-To: <C9EFC294-83B5-41FD-9542-60FDBB2588C6@gmail.com>


>Adding a surrogate key to such a table just adds overhead, although that could be useful 
>in case specific rows need updating or deleting without also modifying the other rows with 
>that same data - normally, only insertions and selections happen on such tables though, 
>and updates or deletes are absolutely forbidden - corrections happen by inserting rows with 
>an opposite transaction.

I routinely add surrogate keys like serial col to a table already having a nice candidate keys
to make it easy to join tables.  SQL starts looking ungainly when you have a 3 col primary
key and need to join it with child tables.




view thread (59+ messages)  latest in thread

Message-ID: <161e1761560-58a6-18e4b@webjas-vad211.srv.aolmail.net>
Permalink:  ../161e1761560-58a6-18e4b@webjas-vad211.srv.aolmail.net/
Also on:    postgresql.org/message-id/161e1761560-58a6-18e4b@webjas-vad211.srv.aolmail.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: rakeshkumar464@aol.com, haramrae@gmail.com, melvin6925@gmail.com, theophilusx@gmail.com, finzelj@gmail.com
  Subject: Re: Enforce primary key on every table during dev?
  In-Reply-To: <161e1761560-58a6-18e4b@webjas-vad211.srv.aolmail.net>
  References: <C9EFC294-83B5-41FD-9542-60FDBB2588C6@gmail.com> <161e1761560-58a6-18e4b@webjas-vad211.srv.aolmail.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