前提・実現したいこと
PostgreSQLでDB内容をcsv出力する必要があります。
\copyを使用し、データ内容を出力することは実現できました。
しかし、ファイル名はSQLファイル内に書いた文字列固定になっています。
yyyymmdd ddmmss.csvという形で出力したいです。
試したこと
以下で固定ファイル名のcsvが出力されました。
\COPY テーブル名 TO './CSVOut/ファイル名.csv' WITH CSV DELIMITER ',' NULL AS '' HEADER;
補足情報(FW/ツールのバージョンなど)
PostgreSQLのバージョンは9.1.5です。
It might not be realized on the PostgreSQL scene. Is it possible to use shell or other programming languages to convert the file name to anything you need?
Stan_Dmasan
Thank you for answering.
Since it is said that it can not be done with PostgresSQL, after csv output, we decided to respond by rewriting the file name with BATfail.
Thank you for giving me knowledge.
回答1件
あなたの回答
tips
プレビュー