Skip site navigation (1) Skip section navigation (2)

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$ (view raw, whole thread or download thread mbox)
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


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 

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.


In response to

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group