Re: [SQL] extracting location info from string

2011-05-26 Thread Tarlika Elisabeth Schmitz
On Thu, 26 May 2011 10:15:50 +1200 Andrej wrote: >On 26 May 2011 09:13, Tarlika Elisabeth Schmitz > wrote: >> On Wed, 25 May 2011 09:25:48 -0600 >> Rob Sargent wrote: >> >>> >>> >>>On 05/24/2011 10:57 AM, Lew wrote: Tarlika Elisabeth Schmitz wrote: > CREATE TABLE person > ( >>>

Re: [SQL] extracting location info from string

2011-05-25 Thread Andrej
On 26 May 2011 09:13, Tarlika Elisabeth Schmitz wrote: > On Wed, 25 May 2011 09:25:48 -0600 > Rob Sargent wrote: > >> >> >>On 05/24/2011 10:57 AM, Lew wrote: >>> Tarlika Elisabeth Schmitz wrote: >>> CREATE TABLE person ( id integer NOT NULL, "name" character varying(256) NOT N

[SQL] Re: [SQL] extracting location info from string

2011-05-25 Thread Charlie
Have you looked at http://en.m.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance - Reply message - From: "Tarlika Elisabeth Schmitz" Date: Wed, May 25, 2011 6:13 pm Subject: [SQL] extracting location info from string To: On Wed, 25 May 2011 09:25:48 -0600 Rob Sarg

Re: [SQL] extracting location info from string

2011-05-25 Thread Rob Sargent
On 05/25/2011 03:13 PM, Tarlika Elisabeth Schmitz wrote: On Wed, 25 May 2011 09:25:48 -0600 Rob Sargent wrote: On 05/24/2011 10:57 AM, Lew wrote: Tarlika Elisabeth Schmitz wrote: CREATE TABLE person ( id integer NOT NULL, "name" character varying(256) NOT NULL, "location" character vary

Re: [SQL] extracting location info from string

2011-05-25 Thread Tarlika Elisabeth Schmitz
On Wed, 25 May 2011 09:25:48 -0600 Rob Sargent wrote: > > >On 05/24/2011 10:57 AM, Lew wrote: >> Tarlika Elisabeth Schmitz wrote: >> >>> CREATE TABLE person >>> ( >>> id integer NOT NULL, >>> "name" character varying(256) NOT NULL, >>> "location" character varying(256), >>> CONSTRAINT person_pkey

Re: [SQL] extracting location info from string

2011-05-25 Thread Tarlika Elisabeth Schmitz
On Tue, 24 May 2011 12:57:57 -0400 Lew wrote: >Tarlika Elisabeth Schmitz wrote: >>this was just a TEMPORARY table I created for quick analysis >> of my CSV data (now renamed to temp_person). >Ah, yes, that makes much more sense. Temporary tables such as you >describe can be very convenient and e

Re: [SQL] extracting location info from string

2011-05-25 Thread Rob Sargent
On 05/24/2011 10:57 AM, Lew wrote: Tarlika Elisabeth Schmitz wrote: Lew wrote: That isn't a table structure, that's a freeform text structure. You didn't state your question, Tarlika, but your database structure is terrible. For example, "region" and "country" should be different columns.

Re: [SQL] extracting location info from string

2011-05-25 Thread Lew
Tarlika Elisabeth Schmitz wrote: Lew wrote: That isn't a table structure, that's a freeform text structure. You didn't state your question, Tarlika, but your database structure is terrible. For example, "region" and "country" should be different columns. I presume you are referring to my or

Re: [SQL] extracting location info from string

2011-05-23 Thread Craig Ringer
On 24/05/2011 6:39 AM, Tarlika Elisabeth Schmitz wrote: Indeed. However, the situation is not quite as bleak as it appears: - I am only dealing with 50 countries (Luxemburg and Vatican are not amongst them) - Only for two countries will city/region be displayed instead of country. - Ultimately,

Re: [SQL] extracting location info from string

2011-05-23 Thread Tarlika Elisabeth Schmitz
On Mon, 23 May 2011 13:11:24 +1200 Andrej wrote: >On 23 May 2011 10:00, Tarlika Elisabeth Schmitz > wrote: >> On Sun, 22 May 2011 21:05:26 +0100 >> Tarlika Elisabeth Schmitz wrote: >> >>>A column contains location information, which may contain any of the >>>following: >>> >>>1) null >>>2) count

Re: [SQL] extracting location info from string

2011-05-23 Thread Tarlika Elisabeth Schmitz
On Mon, 23 May 2011 00:25:16 -0400 Lew wrote: >That isn't a table structure, that's a freeform text structure. You >didn't state your question, Tarlika, but your database structure is >terrible. For example, "region" and "country" should be different >columns. I presume you are referring to m

Re: [SQL] extracting location info from string

2011-05-23 Thread Edward W. Rouse
data and is easier to modify in the future. Edward W. Rouse -Original Message- From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of Lew Sent: Monday, May 23, 2011 12:25 AM To: pgsql-sql@postgresql.org Subject: Re: [SQL] extracting location info from

Re: [SQL] extracting location info from string

2011-05-23 Thread Lew
On 05/22/2011 09:42 PM, Craig Ringer wrote: On 23/05/2011 9:11 AM, Andrej wrote: On 23 May 2011 10:00, Tarlika Elisabeth Schmitz wrote: On Sun, 22 May 2011 21:05:26 +0100 Tarlika Elisabeth Schmitz wrote: A column contains location information, which may contain any of the following: 1) null

Re: [SQL] extracting location info from string

2011-05-22 Thread Craig Ringer
On 23/05/2011 9:11 AM, Andrej wrote: On 23 May 2011 10:00, Tarlika Elisabeth Schmitz wrote: On Sun, 22 May 2011 21:05:26 +0100 Tarlika Elisabeth Schmitz wrote: A column contains location information, which may contain any of the following: 1) null 2) country name (e.g. "France") 3) city na

Re: [SQL] extracting location info from string

2011-05-22 Thread Andrej
On 23 May 2011 10:00, Tarlika Elisabeth Schmitz wrote: > On Sun, 22 May 2011 21:05:26 +0100 > Tarlika Elisabeth Schmitz wrote: > >>A column contains location information, which may contain any of the >>following: >> >>1) null >>2) country name (e.g. "France") >>3) city name, region name (e.g. "Bo

Re: [SQL] extracting location info from string

2011-05-22 Thread Tarlika Elisabeth Schmitz
On Sun, 22 May 2011 21:05:26 +0100 Tarlika Elisabeth Schmitz wrote: >A column contains location information, which may contain any of the >following: > >1) null >2) country name (e.g. "France") >3) city name, region name (e.g. "Bonn, Nordrhein-Westfalen") >4) city name, Rg. region name (e.g. "Fra

[SQL] extracting location info from string

2011-05-22 Thread Tarlika Elisabeth Schmitz
A column contains location information, which may contain any of the following: 1) null 2) country name (e.g. "France") 3) city name, region name (e.g. "Bonn, Nordrhein-Westfalen") 4) city name, Rg. region name (e.g. "Frankfurt, Rg. Hessen") 5) city name, Rg region name (e.g. "Frankfurt, Rg Hessen