Re: extracting location info from string

From: Tarlika Elisabeth Schmitz <postgresql3(at)numerixtechnology(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: extracting location info from string
Date: 2011-05-23 15:33:41
Message-ID: 20110523163341.56edb1aa@dick.coachhouse
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, 23 May 2011 00:25:16 -0400
Lew <noone(at)lewscanon(dot)com> 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 original post:
CREATE TABLE person
(
id integer NOT NULL,
"name" character varying(256) NOT NULL,
"location" character varying(256),
CONSTRAINT person_pkey PRIMARY KEY (id)
);

Sorry, this was just a TEMPORARY table I created for quick analysis of
my CSV data (now renamed to temp_person).

The target table is:
CREATE TABLE person
(
id integer NOT NULL,
"name" character varying(100) NOT NULL,
country character varying(3),
county character varying(3),
town character varying(50),
CONSTRAINT trainer_pkey PRIMARY KEY (id),
CONSTRAINT country_person_fk FOREIGN KEY (country)
REFERENCES country (id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE RESTRICT,
CONSTRAINT county_person_fk FOREIGN KEY (country, county)
REFERENCES county (country, code) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
);

--

Best Regards,
Tarlika Elisabeth Schmitz

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dean le Roux 2011-05-23 16:53:47 problem with update data sets from front ends 8.4, Ubuntu 10.04
Previous Message jasmin.dizdarevic 2011-05-23 15:19:10 Re: Which version of PostgreSQL should I use.