Re: OT: Address Fields - Mailing list pgsql-general

From David W Noon
Subject Re: OT: Address Fields
Date
Msg-id e27nv-uv8.ln1@my-pc.ntlworld.com
Whole thread Raw
List pgsql-general
On Thursday 31 Jul 2003 10:39 in
<pan.2003.07.31.09.39.34.792868@salterprojects.com>, 2trax
(2trax@salterprojects.com) wrote:

> It seems to me that the most flexible way is to use a text field to hold
> everything, apart from the country which suits a varchar? and perhaps have
> another dedicated varchar field to hold USA ZIP codes / UK post codes for
> easy searching?

There are ISO standard codes for countries: US, CA, GB, AU, etc.  These each
fit into a fixed-width CHAR(2) field.

I would use a VARCHAR of some large size and map it into structured fields
using views. Each view is built with
   WHERE country_code = 'xx'
for the matching 'xx' in the ISO standard. This will allow you to search in
a structured manner, provided you have the country code.

--
Regards,

Dave  [RLU#314465]
======================================================
dwnoon@spamtrap.ntlworld.com (David W Noon)
Remove spam trap to reply via e-mail.
======================================================

pgsql-general by date:

Previous
From: Chris Travers
Date:
Subject: Re: Moving from MySQL
Next
From: 2trax
Date:
Subject: Re: OT: Address Fields