Schema
Owner
postgres
Tablespace
(default)
Descriptions
Tree table
Columns
PK | FK | Name | Data type | Not null | Unique | Inherited | Default | Description |
---|---|---|---|---|---|---|---|---|
|
tre_id |
serial |
|
nextval('t_tree_tre_tre_id_seq'::regclass) |
digital automatic identifier of the tree |
|||
|
tre_zon_id |
integer |
|
|
|
digital automatic identifier of the study area attached to the tree |
||
|
tre_tax_id |
integer |
|
|
|
digital automatic identifier of the tree's home taxon |
||
|
|
tre_code |
varchar(24) |
|
|
|
Unique name of the tree within the study area |
|
|
|
tre_note |
varchar |
|
|
|
|
Free commentary on the tree |
Foreign Keys
Name | Columns | FK Table | FK Columns | Delete Action | Update Action | Deferrable | Check Time | Description |
---|---|---|---|---|---|---|---|---|
tre_tax_id |
tax_id |
No Action |
No Action |
|
Immediate |
A tree is attached to one and only one taxon |
||
tre_zon_id |
zon_id |
No Action |
No Action |
|
Immediate |
A tree is attached to one and only one study area |
Check Constraints
There are no check constraints for table t_tree_tre
Indices
Name | Type | Function | Columns | Primary Key | Unique | Description |
---|---|---|---|---|---|---|
btree |
|
tre_zon_id, tre_code |
|
The study area / tree code pair is unique |
||
btree |
|
tre_id |
|
|||
btree |
|
tre_tax_id |
|
|
Foreign key index to speed up updates / deletion |
|
btree |
|
tre_zon_id |
|
|
Foreign key index to speed up updates / deletion |
Triggers
There are no triggers for table t_tree_tre
Rules
There are no rules for table t_tree_tre
Policies
There are no policies for table t_tree_tre
Referenced
Table | Schema | Foreign Key | Columns | FK Table | FK Columns | Delete Action | Update Action | Deferrable | Check Time | Description |
---|---|---|---|---|---|---|---|---|---|---|
mtre_tre_id |
tre_id |
No Action |
No Action |
|
Immediate |
a measure must be attached to one and only one object |
||||
sam_tre_id |
tre_id |
No Action |
No Action |
|
Immediate |
|
Properties
Property | Value |
---|---|
Inherited From |
|
Rows |
-1 |
Pages |
0 |
System |
|
Temporary |
|
With OID |
Definition
CREATE TABLE public.t_tree_tre (
tre_id SERIAL,
tre_zon_id INTEGER NOT NULL,
tre_tax_id INTEGER NOT NULL,
tre_code VARCHAR(24) NOT NULL,
tre_note VARCHAR,
CONSTRAINT c_uni_zon_code_tre UNIQUE(tre_zon_id, tre_code),
CONSTRAINT t_tree_tre_pkey PRIMARY KEY(tre_id),
CONSTRAINT c_fk_tax_tre FOREIGN KEY (tre_tax_id)
REFERENCES public.tr_taxon_tax(tax_id)
ON DELETE NO ACTION
ON UPDATE NO ACTION
NOT DEFERRABLE,
CONSTRAINT c_fk_zon_tre FOREIGN KEY (tre_zon_id)
REFERENCES public.tr_study_zone_zon(zon_id)
ON DELETE NO ACTION
ON UPDATE NO ACTION
NOT DEFERRABLE
) ;
COMMENT ON TABLE public.t_tree_tre
IS 'Tree table';
COMMENT ON COLUMN public.t_tree_tre.tre_id
IS 'digital automatic identifier of the tree';
COMMENT ON COLUMN public.t_tree_tre.tre_zon_id
IS 'digital automatic identifier of the study area attached to the tree';
COMMENT ON COLUMN public.t_tree_tre.tre_tax_id
IS 'digital automatic identifier of the tree''s home taxon';
COMMENT ON COLUMN public.t_tree_tre.tre_code
IS 'Unique name of the tree within the study area';
COMMENT ON COLUMN public.t_tree_tre.tre_note
IS 'Free commentary on the tree';
COMMENT ON CONSTRAINT c_fk_tax_tre ON public.t_tree_tre
IS 'A tree is attached to one and only one taxon';
COMMENT ON CONSTRAINT c_fk_zon_tre ON public.t_tree_tre
IS 'A tree is attached to one and only one study area';
COMMENT ON CONSTRAINT c_uni_zon_code_tre ON public.t_tree_tre
IS 'The study area / tree code pair is unique';
CREATE INDEX x_btr_fkey_tax_tre ON public.t_tree_tre
USING btree (tre_tax_id);
COMMENT ON INDEX public.x_btr_fkey_tax_tre
IS 'Foreign key index to speed up updates / deletion';
CREATE INDEX x_btr_fkey_zon_tre ON public.t_tree_tre
USING btree (tre_zon_id);
COMMENT ON INDEX public.x_btr_fkey_zon_tre
IS 'Foreign key index to speed up updates / deletion';
This file was generated with SQL Manager for PostgreSQL (www.pgsqlmanager.com) |