pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>
To: pgsql-sql@postgresql.org
Subject: Re: extracting location info from string
Date: Mon, 23 May 2011 16:33:41 +0100
Message-ID: <20110523163341.56edb1aa@dick.coachhouse> (raw)
In-Reply-To: <ircnj2$cpt$1@news.albasani.net>
References: <20110522210526.0f8b66fa@dick.coachhouse>
	<20110522230041.28d1bc35@dick.coachhouse>
	<BANLkTikGzsrvXprLXeN3TxZwA=M8fzkn=g@mail.gmail.com>
	<4DD9BB87.7070000@postnewspapers.com.au>
	<ircnj2$cpt$1@news.albasani.net>

On Mon, 23 May 2011 00:25:16 -0400
Lew <noone@lewscanon.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



view thread (17+ messages)  latest in thread

Message-ID: <20110523163341.56edb1aa@dick.coachhouse>
Permalink:  ../20110523163341.56edb1aa@dick.coachhouse/
Also on:    postgresql.org/message-id/20110523163341.56edb1aa@dick.coachhouse

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: postgresql3@numerixtechnology.de
  Subject: Re: extracting location info from string
  In-Reply-To: <20110523163341.56edb1aa@dick.coachhouse>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox