Re: Enforce primary key on every table during dev? - Mailing list pgsql-general

From Rakesh Kumar
Subject Re: Enforce primary key on every table during dev?
Date
Msg-id 161e1761560-58a6-18e4b@webjas-vad211.srv.aolmail.net
Whole thread Raw
In response to Re: Enforce primary key on every table during dev?  (Alban Hertroys <haramrae@gmail.com>)
Responses Re: Enforce primary key on every table during dev?
Re: Enforce primary key on every table during dev?
List pgsql-general
>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.


pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Version upgrade: is restoring the postgres database needed?
Next
From: Kiran Krishnamachari
Date:
Subject: Custom ranking function for full text search