Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. \d dataset_search
  2. Table "sde.dataset_search"
  3. Column | Type | Modifiers
  4. -------------------------+-----------+-------------------------------------------------------------
  5. id | integer | not null default nextval('dataset_search_id_seq'::regclass)
  6. column_id | integer |
  7. dataset_id | integer |
  8. set_id | integer |
  9. type | integer |
  10. name | text |
  11. display_name | text |
  12. short_label | text |
  13. full_label | text |
  14. taxonomy_terms | text |
  15. description | text |
  16. data_source_description | text |
  17. link | text |
  18. all_words | text |
  19. search | tsvector |
  20. product_ids | integer[] |
  21. group_ids | integer[] |
  22. Indexes:
  23. "dataset_search_pkey" PRIMARY KEY, btree (id)
  24. "dataset_search_column_id_index" btree (column_id)
  25. "dataset_search_dataset_id_index" btree (dataset_id)
  26. "dataset_search_group_ids_index" gist (group_ids gist__intbig_ops)
  27. "dataset_search_product_ids_index" gist (product_ids gist__intbig_ops)
  28. "dataset_search_search_index" gin (search)
  29. "dataset_search_set_id_index" btree (set_id)
  30. "dataset_search_type_index" btree (type)
  31. Foreign-key constraints:
  32. "dataset_search_column_id_fk" FOREIGN KEY (column_id) REFERENCES dataset_column(column_id) ON DELETE CASCADE
  33. "dataset_search_dataset_id_fk" FOREIGN KEY (dataset_id) REFERENCES dataset(dataset_id) ON DELETE CASCADE
  34. "dataset_search_set_id_fk" FOREIGN KEY (set_id) REFERENCES user_site_set(id) ON DELETE CASCADE
  35.  
  36. A function inserts into that table:
  37.  
  38. insert into dataset_search (column_id, type, full_label, description, data_source_description, name, display_name, short_label, link, taxonomy_terms, product_ids, group_ids, all_words, search) values
  39. (_id, _type, full_label, description, data_source_description, name, display_name, short_label, link, taxonomy_terms, product_ids, group_ids,
  40. weightA || ' ' || weightB || ' ' || weightC || ' ' || weightD,
  41. setweight (to_tsvector (weightA), 'A') || setweight (to_tsvector (weightB), 'B') || setweight (to_tsvector (weightC), 'C') || setweight (to_tsvector (weightD), 'D'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement