Re: Data Types

From: Lew <noone(at)lewscanon(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Data Types
Date: 2010-11-06 15:26:03
Message-ID: ib3s1g$ud8$1@news.albasani.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

ALT SHN wrote:
> The reason why I don't want to create separate tables to deal with this
> issue is because this is a provisional information. I'll explain. The

BRAAAAAPPP!

Red herring.

> table "paleosites" is in fact a Shapefile that was imported via PostGIS.
> The column "species" it's only the first impression gathered on field
> work. The real species might take years or even decades to fully
> determine. For example we know that from paleosite "x" we have remains
> of dinossauria but what group? what species? Only laboratory work will
> be able do determine this...

This has nothing to do with normalizing your table to eliminate the array column.

> The column "species" is, therefore, intended to give a first hint. The
> real species- that are fully studied are on a table called "specimens"
> wich is linked to table "species" in a relation 1:m.

So you reassign the species when you get the new data. Simple. You're
complicating things unnecessarily.

> Do you thing that even though this issues I'm still modeling the wrong
> way? If I stick to the original idea (enumerating all the species in
> column "species" with datatype text) maybe I could eliminate the spaces
> (DinossariaCrocodilia) or that's just irrelevant?

Yes, you are modeling it the wrong way. Read up on relational database
normalization.

The notion that the species assignment might change has no relevance to the
flaw in your design. You still face that issue with a bad design, but you add
the additional problems of the bad design. Normalize your database and you'll
still have the "problem" that species assignment might change, but it will be
much, much easier to handle correctly.

--
Lew

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2010-11-06 15:41:53 Re: COPY command and serial columns
Previous Message ALT SHN 2010-11-06 11:48:52 Re: Data Types