Re: Recursive Arrays 101

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: David Blomstrom <david(dot)blomstrom(at)gmail(dot)com>, Alban Hertroys <haramrae(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Recursive Arrays 101
Date: 2015-10-26 14:43:42
Message-ID: 562E3C1E.4020609@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/25/15 8:10 PM, David Blomstrom wrote:
> @ Adrian Klaver: Oh, so you're suggesting I make separate tables for
> kingdoms, classes and on down to species. I'll research foreign keys and
> see what I can come up with. I hope I can make separate tables for
> mammal species, bird species, fish species, etc. There are just so many
> species - especially fish - the spreadsheets I use to organize them are
> just about maxed out as it is.

The suggestion is simply to have 7 tables:

CREATE TABLE kingdom(
kingdom_id serial PRIMARY KEY
, kingdom_name text NOT NULL
, ...
);
CREATE TABLE phylum(
phylum_id serial PRIMARY KEY
, kingdom_id int NOT NULL REFERENCES kingdom
, ...
);
CREATE TABLE class(
...
);

and so-on.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2015-10-26 14:54:29 Re: Recursive Arrays 101
Previous Message Stuart Bishop 2015-10-26 14:31:47 Re: Service not starting on Ubuntu 15.04