postgres13 主从复制
环境 主服务器 地址: 172.24.89.190 从服务器 地址: 172.24.89.191 两台服务器都已经安装了postgres,且版本均为13。安装过程
php xlswriter 导出一对多数据
需求 项目中数据需要导出Excel,数据格式如下 [ { "produce_no": "GD20210331-001", "client_info": "客户一", "url": "blog.68hub.com", "order_items": [ { "produce_order_id": 5070, "produce_name":
postgres备份
备份 pg_dump -c --if-exists -d order_db > order_back_1.dump 此命令输出创建数据库命令之前先清理(drop)该数据库对象。(可以和 pg_rest
使用acme.sh脚本部署HTTPS证书至nginx
配置 对应的项目目录中创建.well-known/acme-challenge文件 mkdir -p /data/wwwroot/blog.68hub.com/.well-known/acme-challenge chown -R root:www /data/wwwroot/blog.68hub.com 创建一
Postgres Check(约束)
键表的约束 -- 使用check 关键字进行字段约束 create table users ( id int primary key, name varchar not null, age int default 20 check (age > 0 and age <=150), created_at timestamp with time zone
PostgreSql13 安装配置与远程连接
源码安装(Centos) # 以下命令需要在root用户下执行 wget https://ftp.postgresql.org/pub/source/v13.0/postgresql-13.0.tar.bz2 # 源码下载 tar xjvf postgresql-13.0.tar.bz2 # 解压至当前文件夹 cd postgresql-13.0