![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
命令行操作
文章平均质量分 74
京密815314
这个作者很懒,什么都没留下…
展开
-
postgresql使用psql.exe命令行快速导入Excel(csv)数据
最近遇到一个需求,定时把csv文件导入到postgresql数据库。查询到可以用命令行导入,使用的是命令行工具psql.exe文件,可是在操作的过程中无法实现自动输入口令这个环节。经过反复寻找资料,找到了解决方法,那就是把口令放在环境变量里。 我使用的是windows2008系统,故按照windows系统的习惯来设置环境变量。 假定服务器在本地127.0.0.1,用户为 user001,口令是:123456,数据库是kmsdb,则批处理test.bat的内容如下,...原创 2021-08-23 15:51:18 · 1822 阅读 · 0 评论 -
postgresql通过设置password file,实现命令行免输口令登陆
注意,需要设置好此文件的访问权限,避免安全隐患。30.13. The Password FileThe file.pgpassin a user's home directory or the file referenced byPGPASSFILEcan contain passwords to be used if the connection requires a password (and no password has been specified otherwise). On...转载 2021-08-21 13:27:07 · 490 阅读 · 0 评论 -
postgresql中通过设置环境变量绕过手工输入口令
postgresql中,通过设置环境变量,可以利用命令行做很多事情,包括绕过手工输入口令的环节。原说明书摘录如下,供大家参阅:33.14.Environment VariablesThe following environment variables can be used to select default connection parameter values, which will be used byPQconnectdb,PQsetdbLoginandPQsetdbif...转载 2021-08-21 13:23:43 · 251 阅读 · 0 评论