PostgreSQL 导出导入表中指定查询数据

1.创建临时表

create table test_view as select * from test where date(to_timestamp(endtime))>='2012-09-02';

2.导出临时表数据为文本

copy test_view to '/home/postgres/test_view.txt' with delimiter as '|';

3.导入文件数据到数据库中指定表 delete from test; copy test from '/home/postgres/test_view.txt' with delimiter as '|';

相关文章

项目需要,有个数据需要导入,拿到手一开始以为是mysql,结果...
本文小编为大家详细介绍“怎么查看PostgreSQL数据库中所有表...
错误现象问题原因这是在远程连接时pg_hba.conf文件没有配置正...
因本地资源有限,在公共测试环境搭建了PGsql环境,从数据库本...
wamp 环境 这个提示就是说你的版本低于10了。 先打印ph...
psycopg2.OperationalError: SSL SYSCALL error: EOF detect...