Re: When to use name verses id - Mailing list pgsql-novice

From Josh Berkus
Subject Re: When to use name verses id
Date
Msg-id web-684387@davinci.ethosmedia.com
Whole thread Raw
In response to Re: When to use name verses id  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Lewis,

> Integer IDs are probably also more compact and faster to compare than
> strings, but this effect is not so strong that it should govern your
> decisions.  If you don't really need an ID column, I think you're
> better off without one.

A number of database books have long discussions on ID columns, keys,
 and how to effeciently identify unique rows.  In fact, half the DB and
 SQL books on either book page (from www.postgresql.org or from
 techdocs.postgresql.org) have such chapters.

Make sure that if you are going to rely on a name column as your unique
 value, that you make it your table's Primary Key or at least put a
 Unique Index on it.  Tables without primary keys are disasters in the
 making ...

-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco

pgsql-novice by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: limit of 16 on arguments to functons
Next
From: Sharon Cowling
Date:
Subject: Problem with joins