PostgreSQL 导出导入表中指定查询数据
发布时间:2020-12-13 17:42:18 所属栏目:百科 来源:网络整理
导读: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
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 '|'; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |