pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Chaney <mdchaney@michaelchaney.com>
To: pgsql-sql@postgresql.org
Subject: Re: User defined types -- Social Security number...
Date: Mon, 1 Mar 2004 15:12:31 -0600
Message-ID: <20040301211231.GA19105@michaelchaney.com> (raw)
In-Reply-To: <m37jy5ryto.fsf@wolfe.cbbrowne.com>
References: <c16fu8$2ro4$1@news.hub.org>
	<200402221132.50311.josh@agliodbs.com>
	<c1bih1$1r8$1@news.hub.org>
	<20040301031716.GB4046@michaelchaney.com>
	<m37jy5ryto.fsf@wolfe.cbbrowne.com>

On Sun, Feb 29, 2004 at 11:11:31PM -0500, Christopher Browne wrote:
> The world rejoiced as mdchaney@michaelchaney.com (Michael Chaney) wrote:
> > Look, you're thinking way too hard on this.  An SSN is a 9-digit number,
> > nothing more.  There are some 9-digit numbers which aren't valid SSN's,
> > and you might want to get fancy and create a constraint for that.
> >
> > Regardless, you are making a *major* mistake of confusing data
> > storage with rendering.  It is common to *render* an SSN as
> > xxx-xx-xxxx and its cousin the FETID (Federal Employers Tax ID) as
> > xx-xxxxxxx.  To store the dashes makes no sense.  They're in the
> > same place each time, it's wasted data.
> >
> > Store the SSN as an "integer".  When you begin to think about this
> > correctly, the "leading zeros" problem disappears since that is also a
> > *rendering* issue.
> 
> Well put.
> 
> The one thing that is a bit unfortunate is that 32 bit ints aren't
> quite big enough for this.  You need 1 extra digit :-(.

For what?  The largest SSN is 999,999,999, a signed 32-bit int goes to
just over 2,000,000,000.  Ever hear of a "4GB limit"?

Michael
-- 
Michael Darrin Chaney
mdchaney@michaelchaney.com
http://www.michaelchaney.com/



view thread (14+ messages)  latest in thread

Message-ID: <20040301211231.GA19105@michaelchaney.com>
Permalink:  ../20040301211231.GA19105@michaelchaney.com/
Also on:    postgresql.org/message-id/20040301211231.GA19105@michaelchaney.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mdchaney@michaelchaney.com
  Subject: Re: User defined types -- Social Security number...
  In-Reply-To: <20040301211231.GA19105@michaelchaney.com>

* 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