我一直在使用psql Postgres终端,通过以下方式将CSV文件导入到表中
COPY tbname FROM
'/tmp/the_file.csv'
delimiter '|' csv;
除了我必须登录到psql终端才能运行它之外,它工作得很好.
我想知道是否有人知道从Linux shell命令行执行类似命令的方法,类似于Postgres如何允许像bellow这样的shell命令
/opt/postgresql/bin/pg_dump dbname > /tmp/dbname.sql
这允许在不登录psql终端的情况下从Linux shell转储数据库.