Advertisement
chrissharp123

Untitled

Jan 21st, 2019
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.36 KB | None | 0 0
  1. evergreen=# \d+ reporter.simple_record
  2. View "reporter.simple_record"
  3. Column | Type | Modifiers | Storage | Description
  4. --------------------+---------+-----------+----------+-------------
  5. id | bigint | | plain |
  6. metarecord | bigint | | plain |
  7. fingerprint | text | | extended |
  8. quality | integer | | plain |
  9. tcn_source | text | | extended |
  10. tcn_value | text | | extended |
  11. title | text | | extended |
  12. uniform_title | text | | extended |
  13. author | text | | extended |
  14. publisher | text | | extended |
  15. pubdate | text | | extended |
  16. series_title | text | | extended |
  17. series_statement | text | | extended |
  18. summary | text | | extended |
  19. isbn | text[] | | extended |
  20. issn | text[] | | extended |
  21. topic_subject | text[] | | extended |
  22. geographic_subject | text[] | | extended |
  23. genre | text[] | | extended |
  24. name_subject | text[] | | extended |
  25. corporate_subject | text[] | | extended |
  26. external_uri | text[] | | extended |
  27. View definition:
  28. SELECT r.id,
  29. s.metarecord,
  30. r.fingerprint,
  31. r.quality,
  32. r.tcn_source,
  33. r.tcn_value,
  34. title.value AS title,
  35. uniform_title.value AS uniform_title,
  36. author.value AS author,
  37. publisher.value AS publisher,
  38. "substring"(pubdate.value, '\d+'::text) AS pubdate,
  39. series_title.value AS series_title,
  40. series_statement.value AS series_statement,
  41. summary.value AS summary,
  42. array_agg(DISTINCT replace("substring"(isbn.value, '^\S+'::text), '-'::text, ''::text)) AS isbn,
  43. array_agg(DISTINCT regexp_replace(issn.value, '^\S*(\d{4})[-\s](\d{3,4}x?)'::text, '\1 \2'::text)) AS issn,
  44. ARRAY( SELECT DISTINCT full_rec.value
  45. FROM metabib.full_rec
  46. WHERE full_rec.tag = '650'::bpchar AND full_rec.subfield = 'a'::text AND full_rec.record = r.id) AS topic_subject,
  47. ARRAY( SELECT DISTINCT full_rec.value
  48. FROM metabib.full_rec
  49. WHERE full_rec.tag = '651'::bpchar AND full_rec.subfield = 'a'::text AND full_rec.record = r.id) AS geographic_subject,
  50. ARRAY( SELECT DISTINCT full_rec.value
  51. FROM metabib.full_rec
  52. WHERE full_rec.tag = '655'::bpchar AND full_rec.subfield = 'a'::text AND full_rec.record = r.id) AS genre,
  53. ARRAY( SELECT DISTINCT full_rec.value
  54. FROM metabib.full_rec
  55. WHERE full_rec.tag = '600'::bpchar AND full_rec.subfield = 'a'::text AND full_rec.record = r.id) AS name_subject,
  56. ARRAY( SELECT DISTINCT full_rec.value
  57. FROM metabib.full_rec
  58. WHERE full_rec.tag = '610'::bpchar AND full_rec.subfield = 'a'::text AND full_rec.record = r.id) AS corporate_subject,
  59. ARRAY( SELECT full_rec.value
  60. FROM metabib.full_rec
  61. WHERE full_rec.tag = '856'::bpchar AND (full_rec.subfield = ANY (ARRAY['3'::text, 'y'::text, 'u'::text])) AND full_rec.record = r.id
  62. ORDER BY (
  63. CASE
  64. WHEN full_rec.subfield = ANY (ARRAY['3'::text, 'y'::text]) THEN 0
  65. ELSE 1
  66. END)) AS external_uri
  67. FROM biblio.record_entry r
  68. JOIN metabib.metarecord_source_map s ON s.source = r.id
  69. LEFT JOIN metabib.full_rec uniform_title ON r.id = uniform_title.record AND uniform_title.tag = '240'::bpchar AND uniform_title.subfield = 'a'::text
  70. LEFT JOIN metabib.full_rec title ON r.id = title.record AND title.tag = '245'::bpchar AND title.subfield = 'a'::text
  71. LEFT JOIN metabib.full_rec author ON r.id = author.record AND author.tag = '100'::bpchar AND author.subfield = 'a'::text
  72. LEFT JOIN metabib.full_rec publisher ON r.id = publisher.record AND (publisher.tag = '260'::bpchar OR publisher.tag = '264'::bpchar AND publisher.ind2 = '1'::text) AND publisher.subfield = 'b'::text
  73. LEFT JOIN metabib.full_rec pubdate ON r.id = pubdate.record AND (pubdate.tag = '260'::bpchar OR publisher.tag = '264'::bpchar AND publisher.ind2 = '1'::text) AND pubdate.subfield = 'c'::text
  74. LEFT JOIN metabib.full_rec isbn ON r.id = isbn.record AND (isbn.tag = ANY (ARRAY['024'::bpchar, '020'::bpchar])) AND (isbn.subfield = ANY (ARRAY['a'::text, 'z'::text]))
  75. LEFT JOIN metabib.full_rec issn ON r.id = issn.record AND issn.tag = '022'::bpchar AND issn.subfield = 'a'::text
  76. LEFT JOIN metabib.full_rec series_title ON r.id = series_title.record AND (series_title.tag = ANY (ARRAY['830'::bpchar, '440'::bpchar])) AND series_title.subfield = 'a'::text
  77. LEFT JOIN metabib.full_rec series_statement ON r.id = series_statement.record AND series_statement.tag = '490'::bpchar AND series_statement.subfield = 'a'::text
  78. LEFT JOIN metabib.full_rec summary ON r.id = summary.record AND summary.tag = '520'::bpchar AND summary.subfield = 'a'::text
  79. GROUP BY r.id, s.metarecord, r.fingerprint, r.quality, r.tcn_source, r.tcn_value, title.value, uniform_title.value, author.value, publisher.value, ("substring"(pubdate.value, '\d+'::text)), series_title.value, series_statement.value, summary.value;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement