Re: Hierarchical Query Question (PHP)
От | Rob Sargent |
---|---|
Тема | Re: Hierarchical Query Question (PHP) |
Дата | |
Msg-id | 5633ECBF.5050102@gmail.com обсуждение исходный текст |
Ответ на | Re: Hierarchical Query Question (PHP) (David Blomstrom <david.blomstrom@gmail.com>) |
Список | pgsql-general |
On 10/30/2015 04:10 PM, David Blomstrom wrote:
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?)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"?
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.
В списке pgsql-general по дате отправления: