我是靠谱客的博主 拉长跳跳糖,这篇文章主要介绍往postgre插入大量数据,现在分享给大家,希望可以做个参考。

我的目标是插入100000000万条数据

经过实际操作,用以下方法,能在4分钟完成

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
declare ii integer; begin II:=1; FOR ii IN 1..100000000 LOOP INSERT INTO test1(id, test1, test2, test3, test4, test5, test6, test7, test8, test9) VALUES( ii, 'test1', 'test2', 'test3', 'test4', 'test5', 'test6', 'test7', 'test8', 'test9'); end loop; return true; end;

创建存储过程

然后运行

复制代码
1
select * from creatData2() as tab;

 

最后

以上就是拉长跳跳糖最近收集整理的关于往postgre插入大量数据的全部内容,更多相关往postgre插入大量数据内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(65)

评论列表共有 0 条评论

立即
投稿
返回
顶部