<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>karlley_jp</author_name>
  <author_url>https://blog.hatena.ne.jp/karlley_jp/</author_url>
  <blog_title>時々とおまわり</blog_title>
  <blog_url>https://karlley.hatenablog.jp/</blog_url>
  <categories>
    <anon>PostgreSQL</anon>
    <anon>DB</anon>
    <anon>Sinatra</anon>
  </categories>
  <description>Sinatraを使ったメモアプリのDB版を進めています。 テーブルを作成するDDL文を書いたSQLファイルを読み込み、PostgreSQLにテーブル定義したいと思ったので調べてみました。 結論 psql コマンドの-f オプションを使ってDDLを定義したSQLファイルを読み込んでテーブル定義する。 psql コマンドの-c と-f オプション コマンドラインから実行するpsql コマンドは次のようなオプションが用意されている。 -c: コマンドラインからSQL実行ができる。 -f: コマンドラインからファイル実行できる。 # コマンドラインからSQLを実行(SQL文の末尾の;は不要) $ ps…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkarlley.hatenablog.jp%2Fentry%2F2022%2F07%2F30%2F081553&quot; title=&quot;SQLファイルをコマンドラインから実行してテーブル定義する - 時々とおまわり&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-07-30 08:15:53</published>
  <title>SQLファイルをコマンドラインから実行してテーブル定義する</title>
  <type>rich</type>
  <url>https://karlley.hatenablog.jp/entry/2022/07/30/081553</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
