Обсуждение: Best Practice for Address storage.

Поиск
Список
Период
Сортировка

Best Practice for Address storage.

От
"Daniel Staal"
Дата:
I'm working on a new system that will (hopefully) need to store addresses
for people from anywhere in the world.  The system's still in the design
stage, and I was wondering if anyone had ideas for a best-practice on how
to store those addresses.

Daniel T. Staal

---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------


Re: Best Practice for Address storage.

От
Paula Price
Дата:
I have seen some interesting implementation using vertical tables.
http://weblogs.foxite.com/andykramek/archive/2009/05/03/8369.aspx

Paula Price

> -----Original Message-----
> From: pgsql-novice-owner@postgresql.org [mailto:pgsql-novice-
> owner@postgresql.org] On Behalf Of Daniel Staal
> Sent: Wednesday, July 06, 2011 2:14 PM
> To: pgsql-novice@postgresql.org
> Subject: [NOVICE] Best Practice for Address storage.
> 
> 
> I'm working on a new system that will (hopefully) need to store
> addresses
> for people from anywhere in the world.  The system's still in the
> design
> stage, and I was wondering if anyone had ideas for a best-practice on
> how
> to store those addresses.
> 
> Daniel T. Staal
> 
> ---------------------------------------------------------------
> This email copyright the author.  Unless otherwise noted, you
> are expressly allowed to retransmit, quote, or otherwise use
> the contents for non-commercial purposes.  This copyright will
> expire 5 years after the author's death, or in 30 years,
> whichever is longer, unless such a period is in excess of
> local copyright law.
> ---------------------------------------------------------------
> 
> 
> --
> Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice


Re: Best Practice for Address storage.

От
Daniel Staal
Дата:
--As of July 6, 2011 1:25:12 PM -0700, Paula Price is alleged to have said:

> I have seen some interesting implementation using vertical tables.
> http://weblogs.foxite.com/andykramek/archive/2009/05/03/8369.aspx

--As for the rest, it is mine.

Just wanted to say thanks.  It took some thinking on how that would work
with the rest of the system, but it looks like it should work very well.
It'll be a bit harder to search, (and a good bit less standardized), but it
should allow just about any address to work.

For reference, my current thought is to have a two-dimensional array in one
field of the 'users' table, which will hold the address.  One field of the
array will hold a tag, the other a the entry.  So a US address would end up
looking like this:

{{'street','1 Test Drive'},{'street','Apt.
2'}{'city','Springfield'},{'state','TI'},{'zip','99999'}}

Daniel T. Staal

---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------