Re: PostgreSQL Developer Best Practices - Mailing list pgsql-general

From David G. Johnston
Subject Re: PostgreSQL Developer Best Practices
Date
Msg-id CAKFQuwb99EjirBxFpgwOMi-3=tD95q99MuYvLVSm57e_0CJ0qw@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL Developer Best Practices  (Melvin Davidson <melvin6925@gmail.com>)
List pgsql-general
On Tuesday, August 25, 2015, Melvin Davidson <melvin6925@gmail.com> wrote:
Before ANYONE continues to insist that a serial id column is good, consider the case where the number of tuples will exceed a bigint.
Don't say it cannot happen, because it can.
However, if you have an alphanumeric field, let's say varchar 50, and it's guaranteed that it will never have a duplicate, then THAT is a natural primary
key and beats the hell out of a generic "id" field.
 
Except for it being fatter.  400 bits wide instead of 64.  But that, too, is simply another consideration to evaluate.

David J.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: PostgreSQL Developer Best Practices
Next
From: Craig Ringer
Date:
Subject: Re: BDR: cannot remove node from group