<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>frontline</author_name>
  <author_url>https://blog.hatena.ne.jp/frontline/</author_url>
  <blog_title>misc.log</blog_title>
  <blog_url>https://www.backyrd.net/</blog_url>
  <categories>
    <anon>業務日誌</anon>
    <anon>PostgreSQL</anon>
    <anon>DB</anon>
  </categories>
  <description>結論。HEX化したデータをファイルとして取り込もうとしてもうまくいきません。権限が足りませんでした（そして権限を増やせる環境ではないので却下）。どうしたかというと、 事前にText型だけを持つ一時テーブルを用意する。 Vimのxxdコマンドを使ってHEX化したファイルをメモ帳で開く。 巨大な「16進数文字の羅列」をコピペしてInsert文に書き、上記1のText型列を持つテーブルに突っ込む。 最終的にバイナリとして書きたいbytea型を持つテーブルに、InsertやUpdateで「decode(列名,'hex')」をかまして転記する これでいけました。厳密にはxxdを通した時点で改行コード云々…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.backyrd.net%2Fentry%2F20151007%2F1444204979&quot; title=&quot;PostgreSQLのbytea列にバイナリデータを突っ込む - misc.log&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>http://ecx.images-amazon.com/images/I/419SM7TDHZL.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2015-10-07 17:02:59</published>
  <title>PostgreSQLのbytea列にバイナリデータを突っ込む</title>
  <type>rich</type>
  <url>https://www.backyrd.net/entry/20151007/1444204979</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
