PostgreSQL

Windows版PostgreSQLでCOPY句を使用してデータの出力/投入

投稿日:

出力パスはE''でエスケープが必要

<カンマ区切り>
COPY (SELECT * FROM table_name) TO E'C:\\data.csv' DELIMITER ',';
COPY table_name FROM E'C:\\data.csv' with csv;
<タブ区切り>
COPY (SELECT * FROM table_name) TO E'C:\\data.csv' DELIMITER E'\t';
COPY table_name FROM E'C:\\data.csv'

-PostgreSQL

Copyright© Webラボラトリ         Created by WATERFALL STUDIO , 2019 All Rights Reserved Powered by STINGER.