Modify growth since id
select setval('tide_fofa(表名称)_id_seq',(select max(id) from tide_fofa(表名称)));
Forced to kill the database process
select pg_terminate_backend(pid) from pg_stat_activity where DATNAME = 'isip_test'(表名称);
docker container operations:
Export database:
docker exec -t -u postgres 6974 pg_dumpall -c > dump.sql
Restore the database:
cat your_dump.sql | docker exec -i {docker-postgres-container} psql -U {user} -d {database_name}
Host operating:
Host backup of the database:
pg_dump -h 192.168.199.253(主机ip) -U isip(用户名) isip(数据库名称) > /tmp/beifen253.sql(备份地址)
Host to restore the database:
psql -h 192.168.199.253(主机 ip) -U isip(用户名) -d isip(数据库名称) < /beifen.253.sql