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 1erN09-0000Gf-Uc for pgsql-general@arkaria.postgresql.org; Thu, 01 Mar 2018 12:07:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1erN07-0000sF-BI for pgsql-general@arkaria.postgresql.org; Thu, 01 Mar 2018 12:07:55 +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 1erN06-0000s4-Jk for pgsql-general@lists.postgresql.org; Thu, 01 Mar 2018 12:07:55 +0000 Received: from omr-a010e.mx.aol.com ([204.29.186.54]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1erN03-0006WG-8b for pgsql-general@postgresql.org; Thu, 01 Mar 2018 12:07:53 +0000 Received: from mtaomg-aab01.mx.aol.com (mtaomg-aab01.mx.aol.com [172.26.126.207]) by omr-a010e.mx.aol.com (Outbound Mail Relay) with ESMTP id 47FB1380007F; Thu, 1 Mar 2018 07:07:48 -0500 (EST) Received: from core-aaa07c.mail.aol.com (core-aaa07.mail.aol.com [172.26.125.7]) by mtaomg-aab01.mx.aol.com (OMAG/Core Interface) with ESMTP id 0525238000085; Thu, 1 Mar 2018 07:07:48 -0500 (EST) Received: from 69.248.80.3 by webjas-vad211.srv.aolmail.net (10.96.35.214) with HTTP (WebMailUI); Thu, 01 Mar 2018 07:07:47 -0500 Date: Thu, 1 Mar 2018 07:07:47 -0500 From: Rakesh Kumar To: haramrae@gmail.com, melvin6925@gmail.com Cc: theophilusx@gmail.com, finzelj@gmail.com, pgsql-general@postgresql.org Message-Id: <161e1761560-58a6-18e4b@webjas-vad211.srv.aolmail.net> In-Reply-To: Subject: Re: Enforce primary key on every table during dev? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-MB-Message-Source: WebUI X-MB-Message-Type: User X-Mailer: JAS STD X-Originating-IP: [69.248.80.3] x-aol-global-disposition: G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mx.aol.com; s=20150623; t=1519906068; bh=9e06FyIc2iTvuAI5wVx3m+rXItJk6vedDpvgZes8wT4=; h=From:To:Subject:Message-Id:Date:MIME-Version:Content-Type; b=NW0xl1b51SUSdWRHDyuPVZTEkNbzVZ/QR/Dfqjgos2dLtam6lINpGKEbPXybq8a8F zprYTgok5iamltDfukAkRdATQtW3herEtePotdz3y840vbT9dCec7YZJponlalcdjC 3kjZpL9egPY/MZhXhHg7cP8nRxBsDsSmROFfqyw4= x-aol-sid: 3039ac1a7ecf5a97ed143348 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >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.