{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"PostgreSQLインポート連携","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"postgresqlインポート連携","__idx":0},"children":["PostgreSQLインポート連携"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PostgreSQL用データコネクタを使用すると、PostgreSQLデータベースからTreasure Dataにデータを直接インポートできます。PostgreSQLデータのエクスポートについては、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/int/postgresql-export-integration"},"children":["PostgreSQLエクスポート連携"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"前提条件","__idx":1},"children":["前提条件"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treasure Dataの基本知識"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["PostgreSQLの基本知識"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["リモート"]},"で実行されているPostgreSQLインスタンス(例:RDS上)"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"treasure-data-integration-の静的-ip-アドレス","__idx":2},"children":["Treasure Data Integration の静的 IP アドレス"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["セキュリティポリシーで IP ホワイトリストが必要な場合は、接続を成功させるために Treasure Data の IP アドレスを許可リストに追加する必要があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リージョンごとに整理された静的 IP アドレスの完全なリストは、次のリンクにあります:"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/ip-addresses-integrations-result-workers"},"children":["IP Addresses for Integrations"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"treasure-コンソールを使用したpostgresqlからのインポート","__idx":3},"children":["Treasure コンソールを使用したPostgreSQLからのインポート"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"authenticationの作成","__idx":4},"children":["Authenticationの作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データ接続を設定する際、連携にアクセスするためのAuthenticationを提供します。Treasure Dataでは、Authenticationを設定してからソース情報を指定します。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure コンソール"]},"を開きます。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Integrations Hub"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Catalog"]},"に移動します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["PostgreSQLを検索して選択します。",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create"]},"を選択します。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200807-223217.e12f01c92947408583fc23ce8b3aa685bc13b3aa4dd17f5289ba97dc2aa5ff53.0a0f313e.png","alt":""},"children":[]}," ","4. 次のダイアログが開きます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200807-223310.42cc63fd8fcebfbb09119a91a2366037d0bb3c8ac869ffac5f6d77e2aa52d6e8.0a0f313e.png","alt":""},"children":[]},{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200807-223337.b2fb9306e1c756327fc3e5a97ae3ada3e132e3006642f4937eec0fd6cd5a9034.0a0f313e.png","alt":""},"children":[]}," ","5. 必要なAuthentication情報を入力し、パラメータを設定します。",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Continue"]},"を選択します。"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"パラメータ"},"children":["パラメータ"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"説明"},"children":["説明"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Host"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["IPアドレスなど、ソースデータベースのホスト情報。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Port"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ソースインスタンスの接続ポート。PostgreSQLのデフォルトは5432です。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["User"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ソースデータベースに接続するためのユーザー名。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Password"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ソースデータベースに接続するためのパスワード。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use SSL"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SSLを使用して接続する場合は、このボックスをチェックします。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Specify SSL version"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["接続に使用するSSLバージョンを選択します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Socket connection timeout"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ソケット接続のタイムアウト(秒単位)(デフォルトは300)。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Network timeout"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ネットワークソケット操作のタイムアウト(秒単位)。0はタイムアウトなしを意味します。"]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":6},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["接続の名前を入力します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done"]},"を選択します。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ソースの作成","__idx":5},"children":["ソースの作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Authentication済み接続を作成すると、自動的にAuthenticationsに移動します。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["作成した接続を検索します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New Source"]},"を選択します。Create Sourceダイアログが開きます。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"_","__idx":6},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Connection"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Data Transferフィールドに",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Source"]},"の名前を入力します。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200807-224143.be148c35b05d7c1f6d5e5e3b2dc090ca71204e9ea769eb48724acae4e5e22edf.0a0f313e.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},"をクリックします。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"_-1","__idx":7},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Source Table"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["次のパラメータを編集します"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/postgresql-import-integration-2024-03-22-3.b0dc52811d5498dffd3736b63c338b7865379687dc59aecd393c1c7286c225fa.0a0f313e.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["パラメータ"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["説明"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Driver version"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PostgreSQL JDBCドライバーを選択します"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Database name"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["データを転送するデータベースの名前。例:your_database_name。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use custom SELECT query?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["単純なSELECT (columns) FROM table WHERE (condition)以上のものが必要な場合に使用します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SELECT columns"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["データを取得したい特定のカラムがある場合は、ここにリストします。それ以外の場合は、すべてのカラムが転送されます。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Table"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["データをインポートするテーブル。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["WHERE condition"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["テーブルから取得するデータに追加の条件が必要な場合は、WHERE句の一部として指定します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ORDER BY"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["特定のフィールドでレコードを順序付けする必要がある場合は指定します。"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"_-2","__idx":8},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Settings"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},"を選択します。Data Settingsページが開きます。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["必要に応じてデータ設定を編集するか、このページをスキップします。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200807-230323.c09b390ba74f7c7597deb4080e0aa3d5d43b12238e79df926f38ed27d0af0085.0a0f313e.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["パラメータ"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["説明"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Incremental"]},":"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["この転送を繰り返し実行する場合は、このチェックボックスを選択して、前回インポートが実行されてからのデータのみをインポートします。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Rows per batch"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["非常に大きなデータセットはメモリの問題を引き起こし、結果としてジョブが失敗する可能性があります。このフラグを使用して、行数でインポートジョブをバッチに分割し、メモリの問題やジョブの失敗の可能性を減らします。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Default timezone"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["インポート時に使用するタイムゾーン。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["After SELECT"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["このSQLは、同じトランザクション内のSELECTクエリの後に実行されます。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Column Options"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["このオプションを選択して、インポート前にカラムのタイプを変更します。入力したデータ設定を保存するには、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"を選択します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Default Column Options"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["このオプションを選択して、インポート前にデフォルトのSQLタイプに従ってデータタイプを定義します。入力したデータ設定を保存するには、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"を選択します。     このオプションはTreasure コンソールでは使用できません。Treasure CLIまたはTreasure ワークフローを使用してこのオプションを設定します。"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-preview","__idx":9},"children":["Data Preview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["インポートを実行する前に、Generate Preview を選択してデータの",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/batch/import/previewing-your-source-data"},"children":["プレビュー"]},"を表示できます。Data preview はオプションであり、選択した場合はダイアログの次のページに安全にスキップできます。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]}," を選択します。Data Preview ページが開きます。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["データをプレビューする場合は、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Generate Preview"]}," を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["データを確認します。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-placement","__idx":10},"children":["Data Placement"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データの配置について、データを配置したいターゲット database と table を選択し、インポートを実行する頻度を指定します。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]}," を選択します。Storage の下で、インポートされたデータを配置する新しい database を作成するか、既存の database を選択し、新しい table を作成するか、既存の table を選択します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Database"]}," を選択 > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Select an existing"]}," または ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create New Database"]}," を選択します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["オプションで、database 名を入力します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Table"]}," を選択 > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Select an existing"]}," または ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create New Table"]}," を選択します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["オプションで、table 名を入力します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データをインポートする方法を選択します。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Append"]}," (デフォルト) - データインポートの結果は table に追加されます。"," ","table が存在しない場合は作成されます。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Always Replace"]}," - 既存の table の全体の内容をクエリの結果出力で置き換えます。table が存在しない場合は、新しい table が作成されます。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Replace on New Data"]}," - 新しいデータがある場合のみ、既存の table の全体の内容をクエリの結果出力で置き換えます。"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Timestamp-based Partition Key"]}," 列を選択します。"," ","デフォルトキーとは異なるパーティションキーシードを設定したい場合は、long または timestamp 列をパーティショニング時刻として指定できます。デフォルトの時刻列として、add_time フィルターで upload_time を使用します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データストレージの ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Timezone"]}," を選択します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schedule"]}," の下で、このクエリを実行するタイミングと頻度を選択できます。"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"一度だけ実行","__idx":11},"children":["一度だけ実行"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Off"]}," を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Scheduling Timezone"]}," を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create & Run Now"]}," を選択します。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"定期的に繰り返す","__idx":12},"children":["定期的に繰り返す"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["On"]}," を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schedule"]}," を選択します。UI では、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["@hourly"]},"、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["@daily"]},"、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["@monthly"]},"、またはカスタム ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["cron"]}," の 4 つのオプションが提供されます。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Delay Transfer"]}," を選択して、実行時間の遅延を追加することもできます。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Scheduling Timezone"]}," を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create & Run Now"]}," を選択します。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["転送が実行された後、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Databases"]}," で転送の結果を確認できます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"詳細情報","__idx":13},"children":["詳細情報"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/embulk/embulk-input-jdbc/tree/master/embulk-input-postgresql"},"children":["PostgreSQLデータコネクタのオプション一覧"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"clitoolbeltを使用したpostgresqlからのインポート","__idx":14},"children":["CLI(Toolbelt)を使用したPostgreSQLからのインポート"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"tdコマンドのインストール","__idx":15},"children":["'td'コマンドのインストール"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["最新の",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/td-toolbelt"},"children":["Treasure Data Toolbelt"]},"をインストールします。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"seed設定ファイルseedymlの作成","__idx":16},"children":["Seed設定ファイル(seed.yml)の作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PostgreSQLアクセス情報で",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["seed.yml"]},"を設定します:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: postgresql\n  host: postgresql_host_name\n  port: 5432\n  ssl: true\n  ssl_version: TLS\n  user: test_user\n  password: test_password\n  driver_version: 42.7.x\n  database: test_database\n  table: test_table\n  select: \"*\"\n  default_column_options:\n    TIMESTAMP: {type: string, timestamp_format: '%Y-%m-%d', timezone: '+0900'}\n    BIGINT: {type: string}\n  mode: replace\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["この例では、テーブル内のすべてのレコードをインポートします。",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/embulk/embulk-input-jdbc/tree/master/embulk-input-postgresql"},"children":["追加パラメータ"]},"を使用して、より詳細な制御を行うことができます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["利用可能なoutモードまたは利用可能なssl_versionの詳細については、付録を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"フィールドの推測loadymlの生成","__idx":17},"children":["フィールドの推測(load.ymlの生成)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["td connector:guess"]},"を使用します。このコマンドは、ターゲットデータを自動的に読み取り、データ形式をインテリジェントに推測します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:guess seed.yml -o load.yml\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["load.yml"]},"を開くと、場合によってはファイル形式、エンコーディング、カラム名、タイプを含む、推測されたファイル形式定義が表示されます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"オプション-インポートするデータのプレビュー","__idx":18},"children":["オプション: インポートするデータのプレビュー"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["td connector:preview"]},"コマンドを使用して、インポートするデータをプレビューできます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:preview load.yml\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ロードジョブの実行","__idx":19},"children":["ロードジョブの実行"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ロードジョブを送信します。データサイズに応じて、ジョブの実行に数時間かかる場合があります。データが保存されているデータベースとテーブルを指定する必要があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Dataのストレージは時間でパーティション分割されているため、--time-columnオプションを指定することをお勧めします(データパーティショニングも参照)。オプションが指定されていない場合、データコネクタは最初のlongまたはtimestampカラムをパーティショニング時間として選択します。--time-columnで指定されたカラムのタイプは、longまたはtimestampタイプである必要があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データに時間カラムがない場合は、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["add_time"]},"フィルターオプションを使用して追加できます。詳細については、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/add_time-filter-function"},"children":["add_timeフィルタープラグイン"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:issue load.yml --database td_sample_db --table td_sample_table\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["connector:issue"]},"コマンドは、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["database(td_sample_db)",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["と"]},"table(td_sample_table)",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["をすでに作成していることを前提としています。データベースまたはテーブルがTDに存在しない場合、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["connector:issue"]},"コマンドは失敗します。この場合、データベースとテーブルを",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/data-management"},"children":["手動で"]},"作成するか、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["td connector:issue"]},"コマンドで"]},"--auto-create-table"]},"オプションを使用して、データベースとテーブルを自動作成します:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:issue load.yml \\\n--database td_sample_db --table td_sample_table \\\n--time-column created_at --auto-create-table\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["\"--time-column\"オプションで、Time FormatカラムをPartitioning Keyに割り当てることができます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"workflowを使用したpostgresqlからのインポート","__idx":20},"children":["Workflowを使用したPostgreSQLからのインポート"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PostgreSQLからデータをインポートする方法を示すサンプルワークフローについては、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/treasure-boxes/tree/master/td_load/postgresql"},"children":["Treasure Boxes"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"インクリメンタルロード","__idx":21},"children":["インクリメンタルロード"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["テーブルからカラムを",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["incremental_column"]},"sパラメータに指定することで、レコードをインクリメンタルにロードできます。オプションで、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["last_record"]},"パラメータにいくつかの初期値を指定できます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: postgresql\n  host: postgresql_host_name\n  port: 5432\n  user: test_user\n  password: test_password\n  database: test_database\n  table: test_table\n  incremental: true\n  incremental_columns: [id, created_at]\n  last_record: [10000, '2014-02-16T13:01:06.000000Z']\nout:\n  mode: append\n  exec: {}\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["incremental\\_columns:"]},"オプションを最適に使用するには、関連するカラムにインデックスを作成して、フルテーブルスキャンを回避します。この例では、次のインデックスを作成する必要があります:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"CREATE INDEX embulk_incremental_loading_index ON test_table (id, created_at);\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"-- last_recordが指定されていない場合\nSELECT * FROM(\n    ...original query is here\n)\nORDER BY id, created_at\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"-- last_recordが指定された場合\nSELECT * FROM(\n    ...original query is here\n)\nWHERE id > 10000 OR (id = 10000 AND created_at > '2014-02-16T13:01:06.000000Z')\nORDER BY id, created_at\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["コネクタは自動的に",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["last_record"]},"を生成し、次のスケジュール実行時にそれを使用します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: postgresql\n  ...\nout:\n  ...\n\nConfig Diff\n---\nin:\n  last_record:\n  - 20000\n  - '2015-06-16T16:32:14.000000Z'\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["incremental: true"]},"を設定すると、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["query"]},"オプションは使用できません。"," ","incremental_columnsとしてサポートされているのは、文字列、整数、timestamp、およびtimestamptz(タイムゾーン付きタイムスタンプ)のみです。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"array-columnの読み込み","__idx":22},"children":["Array Columnの読み込み"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PostgreSQLの",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["array"]},"型は、文字列型として取得されます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"hstore-columnの読み込み","__idx":23},"children":["hstore Columnの読み込み"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PostgreSQLのhstore型は、データコネクタが最初に読み取るときに文字列型として取得されます。したがって、hstore型をjson型として使用する場合は、config_optionsを指定して、明示的に型をjson型に変換する必要があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、v_hstoreがPostgreSQLでhstore型の場合:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: postgresql\n  host: xxx\n  ...\n  table: my_tbl\n  select: \"*\"\n  column_options:\n    v_hstore: {type: json} # 明示的な型変換: string型からjson型へ\nout:\n  ...\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"sslバージョン","__idx":24},"children":["SSLバージョン"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ssl_version"]},"オプションを使用して、PostgreSQLサーバーが使用している特定のSSLバージョンを使用できます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: postgresql\n  ...\n  ssl: true\n  ssl_version: TLSv1.1\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["サポートされている値は次のとおりです。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TLS"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TLSv1.1"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TLSv1.2"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TLSv1.3"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"default-column-options","__idx":25},"children":["Default Column Options"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["SQLデータ型の特定のデフォルト形式を使用できます。"," ","以下の例では、TIMESTAMPは",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["%Y-%m-%d"]},"形式でタイムゾーン",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+0900"]},"の文字列に変換されます。"," ","SQLタイプは、TIMESTAMPやBIGINTなどの大文字である必要があります。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: postgresql\n  ...\n   default_column_options:\n    TIMESTAMP: {type: string, timestamp_format: '%Y-%m-%d', timezone: '+0900'}\n    BIGINT: {type: string}  \n","lang":"yaml"},"children":[]}]},"headings":[{"value":"PostgreSQLインポート連携","id":"postgresqlインポート連携","depth":1},{"value":"前提条件","id":"前提条件","depth":2},{"value":"Treasure Data Integration の静的 IP アドレス","id":"treasure-data-integration-の静的-ip-アドレス","depth":2},{"value":"Treasure コンソールを使用したPostgreSQLからのインポート","id":"treasure-コンソールを使用したpostgresqlからのインポート","depth":2},{"value":"Authenticationの作成","id":"authenticationの作成","depth":3},{"value":"ソースの作成","id":"ソースの作成","depth":3},{"value":"","id":"_","depth":3},{"value":"","id":"_-1","depth":3},{"value":"","id":"_-2","depth":3},{"value":"Data Preview","id":"data-preview","depth":3},{"value":"Data Placement","id":"data-placement","depth":3},{"value":"一度だけ実行","id":"一度だけ実行","depth":4},{"value":"定期的に繰り返す","id":"定期的に繰り返す","depth":4},{"value":"詳細情報","id":"詳細情報","depth":2},{"value":"CLI(Toolbelt)を使用したPostgreSQLからのインポート","id":"clitoolbeltを使用したpostgresqlからのインポート","depth":2},{"value":"'td'コマンドのインストール","id":"tdコマンドのインストール","depth":3},{"value":"Seed設定ファイル(seed.yml)の作成","id":"seed設定ファイルseedymlの作成","depth":3},{"value":"フィールドの推測(load.ymlの生成)","id":"フィールドの推測loadymlの生成","depth":3},{"value":"オプション: インポートするデータのプレビュー","id":"オプション-インポートするデータのプレビュー","depth":3},{"value":"ロードジョブの実行","id":"ロードジョブの実行","depth":2},{"value":"Workflowを使用したPostgreSQLからのインポート","id":"workflowを使用したpostgresqlからのインポート","depth":2},{"value":"インクリメンタルロード","id":"インクリメンタルロード","depth":3},{"value":"Array Columnの読み込み","id":"array-columnの読み込み","depth":3},{"value":"hstore Columnの読み込み","id":"hstore-columnの読み込み","depth":3},{"value":"SSLバージョン","id":"sslバージョン","depth":3},{"value":"Default Column Options","id":"default-column-options","depth":3}],"frontmatter":{"seo":{"title":"PostgreSQLインポート連携"}},"lastModified":"2026-06-01T09:34:27.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/int/postgresql-import-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}