Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | bigserial | 19 | √ | nextval('nodes_id_seq'::regclass) |
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type_id | int4 | 10 | √ | null |
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| level | int2 | 5 | √ | null |
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| parent_id | int8 | 19 | √ | null |
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| time_start | timestamp | 29,6 | √ | null |
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| time_end | timestamp | 29,6 | √ | null |
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| trase_id | text | 2147483647 | √ | null |
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sub_type_id | int4 | 10 | √ | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| nodes_pkey | Primary key | Asc | id |
| nodes_parent_id_idx | Performance | Asc | parent_id |
| nodes_trase_id_idx | Performance | Asc | trase_id |
| nodes_trase_id_time_start_time_end_idx | Performance | Asc/Asc/Asc | trase_id + time_start + time_end |
| nodes_type_id_idx | Performance | Asc | type_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| unique_trase_id | ( CASE WHEN ((time_start IS NOT NULL) OR (time_end IS NOT NULL) OR (trase_id IS NULL)) THEN true ELSE (trase_id_already_exists(id, trase_id) = false) END) |
| sub_type_is_allowed | ((get_sub_type_type_id((sub_type_id)::bigint) = type_id)) |
| level_not_null_if_trader_node | ((node_level_not_null_if_trader_node(id) = true)) |

