postgresql jdbc driver驱动连接属性列表

原创 2022-05-26 11:32 阅读(1410)次
想清楚postgresql jdbc driver中的连接属性含义,找了半天找不到类似的解释说明,只好上官网查了下,官网上已经都列出来了,这里分享一下地址: [https://jdbc.postgresql.org/documentation/head/connect.html](https://jdbc.postgresql.org/documentation/head/connect.html "https://jdbc.postgresql.org/documentation/head/connect.html") 这里列举几个常用的: loginTimeout = int ...

postgresql主从复制时报错:no pg_hba.conf entry for replication connection from host "192.168.15.131", user

原创 2020-03-20 13:39 阅读(6074)次
今天在部署postgresql主从复制时,复制一直不成功,检查了主从库的配置没发现什么问题,于是修改主库的配置,修改postgresql.conf:logging_collector = on将日志功能打开,重启主库看到日志一直在报错:FATAL: no pg_hba.conf entry for replication connection from host "192.168.15.131", user "replicator", SSL off我以为pg_hba.conf中配置了如下就可以:local replication all ...

linux下docker安装postgreSql数据库,附带启动脚本

原创 2020-03-19 11:14 阅读(1384)次
docker这东西安装中间件真是方便,不需要再去手动下载安装包,省事,今天分享一下我在docker中安装postgresql数据库的过程。1.搜索docker search postgresql2.上面可以看到NAME为postgres的镜像,直接安装,我选择的是10.5版本docker pull postgres:10.53.经过10分钟左右,镜像下载下来了,查看一下docker image listREPOSITORY          TAG              ...

postgresql生成uuid

原创 2020-03-12 15:41 阅读(7484)次
我们postgresql数据库在插入数据时,需要生成uuid当作主键,这里分享下2种做法:1,参考这位朋友提供的https://www.cnblogs.com/chengyungzheng/p/10175515.html2,也可以直接自己拼接一下,但这不建议在高并发下使用,以下三个语句都可以生成SELECT uuid_in(md5(random()::text || now()::text)::cstring); SELECT uuid_in(md5(random()::text || clock_timestamp()::text)::cstring); SELECT md5(r...