Search Postgresql Archives

Re: Hierarchical Query Question (PHP)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/30/2015 04:10 PM, David Blomstrom wrote:
Just so I understand what's going on, I can create a lookup table by pasting this code...

create table taxon (
  taxonid serial,
  descr text
);
create table gz_life_mammals (
  id serial,
  taxonid integer, -- use the lookup table
  parentid integer -- use the lookup table
);

...into pgAdmin III, right? (I can't use the shell/terminal at the moment, and it will be at least a few weeks before I can get it fixed.) And this script will create TWO tables - gz_life_mammals and a matching "lookup table"?

If I'm following correctly it will create two tables, the first is the definition of the lookup table.  You should add an index its taxonid (if 'serial' doesn't imply that?)

In the second table (gz_lief_mamals) have taxonid and parentid as "foreign keys" to taxon.taxonid.

The gui side of pgAdmin3 should help out here, but it's been quite a while since I was there.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux