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

From 2trax
Subject Re: OT: Address Fields
Date
Msg-id pan.2003.08.01.01.31.19.453434@salterprojects.com
Whole thread Raw
In response to Re: OT: Address Fields  (David W Noon <dwnoon@spamtrap.ntlworld.com>)
List pgsql-general
On Thu, 31 Jul 2003 11:19:25 +0100, David W Noon wrote:

> 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.

David,

Thanks for a good suggestion. I'll take a crack at it.

Cheers,

Sam.
---
Posted via news://freenews.netfront.net
Complaints to news@netfront.net

pgsql-general by date:

Previous
From: David W Noon
Date:
Subject: Re: OT: Address Fields
Next
From: Wolfgang Kueter
Date:
Subject: Re: Moving from MySQL