Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1.  
  2. * PostgreSQL 9.4.5
  3. * OS: OSX 10.11
  4.  
  5. ```
  6. select * from 日本語;
  7. 主キー | 名前
  8. -----------+-----------------------
  9. 1 | やまだたろう
  10. 2 | やまかわしろう
  11. (2 rows)
  12. ```
  13.  
  14. ```yaml
  15. in:
  16. type: postgresql
  17. host: localhost
  18. database: dbname
  19. table: "日本語"
  20. user: user
  21. password: pass
  22. #query: "select 主キー,名前 from 日本語"
  23. #out:
  24. # type: stdout
  25. out:
  26. type: file
  27. path_prefix: out
  28. file_ext: csv
  29. formatter:
  30. type: csv
  31. ```
  32.  
  33.  
  34. ```
  35. embulk run hoge.yml
  36. 2016-02-23 10:59:01.740 +0900: Embulk v0.8.5
  37. 2016-02-23 10:59:04.207 +0900 [INFO] (0001:transaction): Loaded plugin embulk-input-postgresql (0.6.4)
  38. 2016-02-23 10:59:04.411 +0900 [INFO] (0001:transaction): SQL: SET search_path TO "public"
  39. 2016-02-23 10:59:04.424 +0900 [INFO] (0001:transaction): SQL: SELECT * FROM "日本語"
  40. 2016-02-23 10:59:04.527 +0900 [INFO] (0001:transaction): Using local thread executor with max_threads=8 / output tasks 4 = input tasks 1 * 4
  41. 2016-02-23 10:59:04.619 +0900 [INFO] (0001:transaction): {done: 0 / 1, running: 0}
  42. 2016-02-23 10:59:04.690 +0900 [INFO] (0017:task-0000): Writing local file 'out000.00.csv'
  43. 2016-02-23 10:59:04.694 +0900 [INFO] (0017:task-0000): Writing local file 'out001.00.csv'
  44. 2016-02-23 10:59:04.696 +0900 [INFO] (0017:task-0000): Writing local file 'out002.00.csv'
  45. 2016-02-23 10:59:04.698 +0900 [INFO] (0017:task-0000): Writing local file 'out003.00.csv'
  46. 2016-02-23 10:59:04.768 +0900 [INFO] (0017:task-0000): SQL: SET search_path TO "public"
  47. 2016-02-23 10:59:04.770 +0900 [INFO] (0017:task-0000): SQL: DECLARE cur NO SCROLL CURSOR FOR SELECT * FROM "日本語"
  48. 2016-02-23 10:59:04.780 +0900 [INFO] (0017:task-0000): SQL: FETCH FORWARD 10000 FROM cur
  49. 2016-02-23 10:59:04.782 +0900 [INFO] (0017:task-0000): > 0.00 seconds
  50. 2016-02-23 10:59:04.796 +0900 [INFO] (0017:task-0000): SQL: FETCH FORWARD 10000 FROM cur
  51. 2016-02-23 10:59:04.797 +0900 [INFO] (0017:task-0000): > 0.00 seconds
  52. 2016-02-23 10:59:04.802 +0900 [INFO] (0001:transaction): {done: 1 / 1, running: 0}
  53. 2016-02-23 10:59:04.883 +0900 [INFO] (main): Committed.
  54. 2016-02-23 10:59:04.888 +0900 [INFO] (main): Next config diff: {"in":{},"out":{}}
  55. ```
  56.  
  57. cat out000.00.csv
  58.  
  59. ```
  60. 主キー,名前
  61. 1,やまだたろう
  62. 2,やまかわしろう
  63. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement