13

Address records are probably used in most database, but I've seen a number of slightly different sets of fields used to store them. The number of fields seems to vary from 3-7, and sometimes all fields are simple labelled address1..addressN, other times given specific meaning (town, city, etc).

This is UK specific, though I'm open to comments about the rest of the world too. Here you need the first line of the address (actually just the number) and the post code to identify the address - everything else is mostly an added bonus.

I'm currently favouring:

  • Address 1
  • Address 2
  • Address 3
  • Town
  • County
  • Post Code

We could add Country if we ever needed it (unlikely).

What do you think? Is this too little, too much?

cHao
  • 84,970
  • 20
  • 145
  • 172
Draemon
  • 33,955
  • 16
  • 77
  • 104

7 Answers7

15

The Post Office suggests (http://www.postoffice.co.uk/portal/po/content1?catId=19100182&mediaId=19100267) 7 lines:

  • Addressees Name
  • Company/Organisation
  • Building Name
  • Number of building and name of thoroughfare
  • Locality Name
  • Post Town
  • Post Code

They then say you do not need to include a County name provided the Post Town and Postcode are used.

chimp
  • 1,823
  • 9
  • 14
  • So that's 5, plus name and company (I'm counting the addressee as separate from the address - ok, it would get added to a printed address). Of course the PO are only concerned with mail getting to it's destination so I think storing a bit extra for human users is probably ok. – Draemon Dec 16 '08 at 23:28
  • Yes, and they also say on that link that naming of houses and roads isn't the PO's responsibility, and who knows what some of these local councils might come up with! – chimp Dec 16 '08 at 23:38
  • 1
    Since this answer was given, the Post Office site has been redesigned, and the new addressing guide appears at http://www.postoffice.co.uk/how-to-address-mail Note: This page has slightly different recommendations to the above answer. – liamja Jun 14 '15 at 11:56
2

The BSI have BS 7666 - that covers all addressing. I recommend you look there.

The 2000 version recommends

An address shall be based upon a logical data model comprising the following entities:

  1. addressable object, with sub-types:
    • primary addressable object;
    • secondary addressable object;
  2. street;
  3. locality;
  4. town;
  5. administrative area, a.k.a. district;
  6. county;
  7. postcode.

See: http://landregistry.data.gov.uk/def/common/BS7666Address

Rick-777
  • 9,714
  • 5
  • 34
  • 50
Johnno Nolan
  • 29,228
  • 19
  • 111
  • 160
  • That appears to be about geospatial data sets rather than (snail) mail addressing. I may be missing something - was there a particular part of the standard that you had in mind, or a particular revision? – Jonathan Leffler Dec 16 '08 at 23:43
  • Note that the list above doesn't include a country field, although one is often required. – Rick-777 Sep 10 '15 at 13:02
  • from Royal Mails PAF Programmers Guide... "The county is not required as part of a correct postal address. We removed the Former Postal County field from PAF raw data products in December 2000.". So the main address files do not contain 'County' (or Country). You can extract them out of the Alias files, but they are historical. – Mark Worrall Feb 03 '20 at 09:51
0

If I were you, I'd call Royal Mail and ask them... or look on their website for postcode lookup as a best practice.

There's different types of addresses, and each different type has a slightly different structure. Forward sorting offices have a different postal address structure than a residential home with a street number. What if the house has a name instead of a number? There are so many factors to consider.

Since I moved to Canada I had to do something similar and it's far more complicated than a straightforward residential address which generally has:

  • Street Number if applicable
  • Street Number Suffix if applicable
  • House Name
  • Street Name
  • Street Type
  • Street Direction if applicable
  • Unit Number for flats, townhouses or other types of building/location
  • Minor Municipality (Village)
  • Major Municipality (Major Town/City)
  • County
  • PostCode
  • Country if you include Scotland, Wales, Northern Ireland (and now I noticed Eire)

Then you get businesses that have their own Delivery Route, PO Boxes, Forward Sortation Offices...

It gets complicated in a real hurry.

Best bet - give Royal Mail a call and they should be able to give you information on their standard address templates.

EDIT: Your 3 field method isn't a bad one...particularly. However, data sanitization may be a significant issue using the field setup you have and you may need a fairly complex strategy for making sure that the address entered is valid. It's far easier to sanitize single dedicated fields to make sure input is correct than it is to parse various address tokens out of combined fields.

Another simpler way to gain this info is to go on the Royal Mail website and check their postcode lookup page.

On their main postcode lookup, they use 4 fields and I guess they have some form of validation on the street name/type field. They separate the house number and name and I guess they only allow major municipality. I'm assuming the county/country are assumed. If you break out their advanced search, they give you two extra fields for flat number and business name.

Given that some fields are combined on their site, you have to assume that there's some amount of validation to make sure that data entered can be gainfully used.

BenAlabaster
  • 39,070
  • 21
  • 110
  • 151
  • This is exactly why I have 3 general fields before everything else. I'd say those 3 are enough to cover any/all of the above that isn't already catered for. It's a good suggestion to phone RM, but having dealt with them before, I doubt it will yield anything fruitful! – Draemon Dec 16 '08 at 23:18
0

I don't know whether this is minimal (I doubt it) but the heading on my cheque book says something pretty close to:

Lloyds TSB
Isle of Man Offshore Centre
Peveril Buildings
Peveril Square
Douglas
Isle of Man
IM99 0XX
United Kingdom

This causes fits when I try to enter it into the US banking system.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
  • This *almost* fits, and I doubt we'd suffer from merging two lines of this or dropping a line if we had to. – Draemon Dec 16 '08 at 23:25
  • Damn, that's some address - I'm surprised that fits into the UK postal system; it's really no surprise it won't work in a U.S. system. – BenAlabaster Dec 17 '08 at 05:19
  • @balabaster: yes, its pretty bad as UK addresses go. We can debate whether the first two lines count as address or as corporate identity - probably the latter. But it still wreaks havoc. Fortunately, there's a bank number that sorts most of it out - the IBAN, IIRC. – Jonathan Leffler Dec 17 '08 at 06:58
0

Premises elements

  • Sub Building Name
  • Building Name
  • Building Number
  • Organisation Name
  • Department Name
  • PO Box Number

Thoroughfare elements

  • Dependent Thoroughfare Name
  • Dependent Thoroughfare Descriptor
  • Thoroughfare Name
  • Thoroughfare Descriptor

Locality elements

  • Double Dependent Locality
  • Dependent Locality
  • Post Town

Postcode element

  • Postcode

This answer may be a few years late, but it's aimed at those like myself looking for guidance on how to correctly format postal addresses for both storing in a database (or the likes of it) and for printing purposes.


Taken from Royal Mail Doc, link below - conveniently titled the 'Programmers Guide'

Page 27 - 42 was most helpful for me.

Luthfur
  • 1
  • 1
-1

It's very likely that a "UK" will be opened to Eire as well, and in some lines of business there will be legal differences, generally between Scotland / NI / the channel islands and England and Wales.

In short, I would add country to the list. Otherwise it's fine (no fewer certainly), though of course any address is traceable from a building reference, a post code and a country alone.

annakata
  • 74,572
  • 17
  • 113
  • 180
-2

Where we live in France its just 3 lines:-

myname
village/location name
6 digit postcode followed by post town name in uppercase

Even from UK that's all that is required

Jack
  • 10,943
  • 13
  • 50
  • 65